Giter Club home page Giter Club logo

Comments (6)

fantasy8-me avatar fantasy8-me commented on July 17, 2024 2

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.

hamishtaplin avatar hamishtaplin commented on July 17, 2024

@jgautheron I'm using it with es6 no problems, seems like an issue with your babel setup to me.

from react-codemirror.

jgautheron avatar jgautheron commented on July 17, 2024

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.

kai23 avatar kai23 commented on July 17, 2024

Have the exact same issue with webpack and ES6

from react-codemirror.

vokar avatar vokar commented on July 17, 2024

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.

OleksiiShevchenko avatar OleksiiShevchenko commented on July 17, 2024

You can change webpack config rather than rename a file #39 (comment)

from react-codemirror.

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.