Comments (10)
Figured it out. draft-js
requires fbjs
, which is responsible for the error. The error occurs because the browser doesn't recognize the UTF-8 characters in the regex posted above.
Solution:
Include <meta charset="utf-8" />
in the <head></head>
block of your HTML file!
from draft-js.
I also got this problem when I using Apache Server to run react app!
main.fd8154e8.js:1 Uncaught SyntaxError: Invalid regular expression: /[A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-Æ¿Ç€-ǃDŽ-ʓʔʕ-ʯʰ-ʸʻ-Ë�Ë�-Ë‘Ë -ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-Ò�Ò‚ÒŠ-Ô¯Ô±-Õ–Õ™Õš-ÕŸÕ¡-և։ःऄ-हऻऽा-ीॉ-ौॎ-à¥�à¥�क़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌà¦�-à¦�ও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-à§�য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊà¨�-à¨�ਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-àª�àª�-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-à«Œà«�à« -ૡ૦-૯૰ଂ-ଃଅ-ଌà¬�-à¬�ଓ-ନପ-ରଲ-ଳଵ-ହଽାà€à‡-àˆà‹-àŒà—àœ-à�àŸ-à¡à¦-à¯à°à±à²-à·à®ƒà®…-ஊஎ-à®�à®’-கங-சஜஞ-டண-தந-பம-ஹா-ிà¯�-ூெ-ைொ-ௌà¯�ௗ௦-௯௰-௲à°�-ఃఅ-ఌఎ-à°�à°’-నప-హఽà±�-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-à²�ಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-à´�à´’-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-à·†à·�-à·‘à·˜-à·Ÿà·¦-෯ෲ-ෳ෴à¸�-ะา-ำเ-ๅๆà¹�à¹�-๙๚-๛àº�-ຂຄງ-ຈຊàº�ດ-ທນ-ຟມ-ຣລວສ-ຫàº-ະາ-ຳຽເ-ໄໆà»�-໙ໜ-ໟༀà¼�-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-à¿�à¿�-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿá�€-á�‰á�Š-á��á��-á�•á�–-á�—á�š-á��á�¡á�¢-á�¤á�¥-á�¦á�§-á�á�®-á�°á�µ-á‚�ႃ-ႄႇ-ႌႎá‚�á‚�-႙ႚ-ႜ႞-á‚Ÿá‚ -ჅჇáƒ�áƒ�-ჺ჻ჼჽ-ቈቊ-á‰�á‰�-ቖቘቚ-á‰�በ-ኈኊ-áŠ�áŠ�-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-áŒ�ጒ-ጕጘ-á�šá� -á�¨á�©-á�¼áŽ€-áŽ�Ꭰ-á�´á��-ᙬá™-᙮ᙯ-ᙿáš�-áššáš -ᛪ᛫-á›á›®-á›°á›±-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶á�€-á�‘á� -á�¬á�®-á�°áž€-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩á �-á ™á -ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-á¥�á¥�-á¥á¥°-ᥴᦀ-ᦫᦰ-ᧀá§�-ᧇᧈ-ᧉá§�-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤá©-ᩲ᪀-᪉áª�-᪙᪠-᪦ᪧ᪨-áªá¬„ᬅ-ᬳᬵᬻᬽ-á�áƒ-á„á…-á‹á�-á™áš-á á¡-áªá´-á¼á®‚ᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-á°«á°´-ᰵ᰻-á°¿á±€-᱉á±�-á±�á±�-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-á´«á´¬-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-á¼�á¼ -ὅὈ-á½�á½�-ὗὙὛá½�Ὗ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-á¿Œá¿�-á¿“á¿–-Ίῠ-Ῥῲ-ῴῶ-ῼ‎â�±â�¿â‚�-ₜℂℇℊ-â„“â„•â„™-â„�ℤΩℨK-â„ℯ-ℴℵ-ℸℹℼ-â„¿â……-ⅉⅎâ…�â… -ↂↃ-ↄↅ-ↈ⌶-â�ºâŽ•â’œ-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧâ´â´°-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-â·Žâ·�-â·–â·˜-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ã��-ã‚–ã‚�-ã‚žã‚Ÿã‚¡-ヺー-ヾヿㄅ-ã„ㄱ-ㆎã†�-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-ã‰�㉠-㉻㉿㊀-㊉㊊-㊰㋀-ã‹‹ã‹�-㋾㌀-ã�¶ã�»-ã��ã� -ã�¾ã�€-䶵一-鿌ꀀ-ꀔꀕꀖ-ê’Œê“�-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌê˜�-ê˜Ÿê˜ -꘩ꘪ-ꘫꙀ-ê™ê™®êš€-ꚛꚜ-êš�êš -ꛥꛦ-ꛯ꛲-꛷Ꜣ-ê�¯ê�°ê�±-ꞇ꞉-꞊Ꞌ-ꞎêž�-êžêž°-Ʇꟷꟸ-ꟹꟺꟻ-ê �ê ƒ-ê …ê ‡-ê Šê Œ-ê ¢ê £-ê ¤ê §ê °-ê µê ¶-ê ·ê¡€-ꡳꢀ-ê¢�ꢂ-ꢳꢴ-ꣃ꣎-ê£�ê£�-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-ê¥“ê¥Ÿê¥ -ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀ê§�-ê§�ê§�ê§�-꧙꧞-ê§Ÿê§ -ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ê©‚ê©„-ê©‹ê©�ê©�-꩙꩜-ê©Ÿê© -ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ê«œê«�ê«ž-ê«Ÿê« -ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵê¬�-ꬆꬉ-ꬎꬑ-ê¬–ê¬ -ꬦꬨ-ꬮꬰ-êšê›êœ-êŸê¤-ê¥ê¯€-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-ï©ï©°-龎ff-stﬓ-ﬗA-Zï½�-zヲ-ッーア-ï¾�゙-ï¾Ÿï¾ -하-ᅦᅧ-ï¿�ï¿’-ï¿—ï¿š-ï¿œÖ�־׀׃׆׈-×�×�-ת׫-ׯװ-ײ׳-×´×µ-׿߀-߉ߊ-ߪߴ-ߵߺ߻-ß¿à €-à •à šà ¤à ¨à ®-à ¯à °-à ¾à ¿à¡€-ࡘ࡜-à¡�à¡žà¡Ÿ-࢟â€�ï¬�ײַ-ﬨשׁ-זּ﬷טּ-לּ﬽מּ﬿ï€-ï�ï‚ïƒ-ï„ï…ï†-ï�؈؋Ø�؛؜Ø�Øž-ØŸØ -ؿـÙ�-ÙŠÙÙ®-ٯٱ-Û“Û”Û•Û¥-Û¦Û®-Û¯Ûº-Û¼Û½-Û¾Û¿Ü€-Ü�ÜŽÜ�Ü�Ü’-ܯ݋-ÝŒÝ�-Þ¥Þ±Þ²-޿ࢠ-ࢲࢳ-ࣣï�-ﮱ﮲-ï¯�﯂-﯒ﯓ-ﴽ﵀-ïµ�ïµ�-ï¶�ï¶�-﶑ﶒ-ﷇ﷈-ï·�ï·°-ﷻ﷼﷾-ï·¿ï¹°-ﹴ﹵ﹶ-ﻼ﻽-﻾]/: Range out of order in character class
at RegExp (<anonymous>)
at Object.<anonymous> (main.fd8154e8.js:1)
at t (main.fd8154e8.js:1)
at Object.<anonymous> (main.fd8154e8.js:1)
at t (main.fd8154e8.js:1)
at Object.<anonymous> (main.fd8154e8.js:1)
at t (main.fd8154e8.js:1)
at Object.<anonymous> (main.fd8154e8.js:1)
at t (main.fd8154e8.js:1)
at Object.<anonymous> (main.fd8154e8.js:1)
solution
just need to set encoding
UTF-8
! @BRWR, thanks a lot!
<meta charset="UTF-8">
<!DOCTYPE html>
<meta charset="UTF-8">
<html lang="zh-Hans">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="./manifest.json">
<link rel="shortcut icon" href=",/favicon.ico">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<title>React App</title>
<link href="./static/css/main.e8e29e73.css" rel="stylesheet">
</head>
<body><noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="text/javascript" src="./static/js/main.fd8154e8.js"></script>
</body>
</html>
from draft-js.
This is just using the same regex as in tweet.html
?
from draft-js.
After a little bit more testing, it appears I get the error by simply adding in an import statement into a component.
import {Editor, EditorState} from 'draft-js';
from draft-js.
from draft-js.
This just happened to me as well. It also happens with the following using Webpack:
const Editor = require('draft-js').Editor;
const EditorState = require('draft-js').EditorState
from draft-js.
That did it! Thanks @BRWR. I thought I had that in there..
from draft-js.
Nice catch, thanks all.
from draft-js.
if I deploy the same app on https server the issue appears again. (There is no issue if bundle served from http server)
from draft-js.
Thanks.
This is working for me
from draft-js.
Related Issues (20)
- read-only font size not working
- Ctrl+A selection doesn't work in Firefox when there are action items
- Bug in demo text editor on website HOT 4
- created by DraftEditorTextNode
- state in decorator are memorised
- Add custom classes
- Ordered and unordered lists don't work
- Is/should convertToRaw be based on some kind of open standard? HOT 1
- How to insert texts via google chrome extension to an input created by DraftJS HOT 1
- Pressing return jumps to start of line in Android API 33 HOT 1
- How to change blockType by pressing keyboard
- why draftInlineStyleType only can be default type? HOT 1
- How to get the cursor position? HOT 4
- URGENT :: How to update words arrays in handleStrategy of decorator?
- how to stop the style i add in replaceText?
- pre select inline style, then input in composition mode, the selected inlinestyle not work
- when input some IME punctuation, the editor crashs
- wrong return value of getInlineStyleForCollapsedSelection and getInlineStyleForNonCollapsedSelection
- http://localhost:8000/
- InvalidStateError: 'extend' requires a Range to be added to the Selection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from draft-js.