Comments (6)
I encounter a similar error
Time: 21025ms
Asset Size Chunks Chunk Names
app.js 8.46 MB 0 main
chunk {0} app.js (main) 3.09 MB [rendered]
ERROR in ./~/react-codemirror/src/codemirror.js
Module parse failed: /Users/me/Work/WS/sublime-master-ws/prj-reedsec/reedsec-dashboard/node_modules/react-codemirror/src/codemirror.js Unexpected token (76:3)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (76:3)
I found the problem caused by webpack loading setting, in below line
https://github.com/JedWatson/react-codemirror/blob/master/src/Codemirror.js#L17
it is expected to load 'codemirror' in 'node_module'
But if we have webpack like below, which treat 'src' as module folder too, then 'https://github.com/JedWatson/react-codemirror/blob/master/src/Codemirror.js' itself might be load and cause the error
resolve: {
modulesDirectories: [
'src',
'node_modules'
],
extensions: ['', '.json', '.js', '.jsx']
},
Remove above resolve setting can solve the problem, but can we change the src file name(Codemirror.js) to avoid conflict with the 'codemirror' module for safety
from react-codemirror.
@jgautheron I'm using it with es6 no problems, seems like an issue with your babel setup to me.
from react-codemirror.
I kind of figured it out, related to server side rendering. The issue is not related to react-codemirror
so I'm closing it.
from react-codemirror.
Have the exact same issue with webpack and ES6
from react-codemirror.
I had had the same problem on the mac os 10.11.6 (with default Journaled HFS+ case-insensitive file-system), but I've already resolved it by changing file name of src/Codemirror.js (thanks fantasy8-me). So I fully agree with fantasy8-me's advice of renaming src file to avoid conflict!
from react-codemirror.
You can change webpack config rather than rename a file #39 (comment)
from react-codemirror.
Related Issues (20)
- Theme syntax highlighting not working HOT 3
- how can I beautify(formatting) code after load HOT 2
- Foldcode not working for me. And not even getting foldgutter. Any help? HOT 3
- Update peerDependencies for react > 16 HOT 1
- Is this library deprecated? HOT 2
- How to integrate codemirror-formatting plugin with react
- Focus lost after typing character HOT 2
- How do I use methods like setSize of an instance?
- How to Set Default Background Color and Default Content Width in Editor?????
- Line numbers sometimes don't load properly using fromTextArea
- Can't use defineMode ?
- beforeChange is not fired?
- autofocus is broken on UnControlled
- how can I use MergeView
- lineNumbers show in preview codemirror
- .
- New project with react-codemirror on typescript HOT 1
- Codemirror syntax highlighting works in preview but not when published
- Support React 17 HOT 1
- When pasting in multi-line values, it pastes twice HOT 2
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 react-codemirror.