Coder Social home page Coder Social logo

Comments (10)

jamesbrewerdev avatar jamesbrewerdev commented on April 23, 2024 48

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.

xyzdata avatar xyzdata commented on April 23, 2024 4

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.

hellendag avatar hellendag commented on April 23, 2024

This is just using the same regex as in tweet.html?

from draft-js.

athomann avatar athomann commented on April 23, 2024

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.

athomann avatar athomann commented on April 23, 2024

screen shot 2016-02-24 at 9 47 13 pm

from draft-js.

jamesbrewerdev avatar jamesbrewerdev commented on April 23, 2024

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.

athomann avatar athomann commented on April 23, 2024

That did it! Thanks @BRWR. I thought I had that in there..

from draft-js.

hellendag avatar hellendag commented on April 23, 2024

Nice catch, thanks all.

from draft-js.

jgzak avatar jgzak commented on April 23, 2024

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.

Rajendra24 avatar Rajendra24 commented on April 23, 2024

Thanks.
This is working for me

from draft-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.