Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: require is not defined (create-react-app v2.0) #20

Open
sartaj10 opened this issue Oct 19, 2018 · 1 comment
Open

ReferenceError: require is not defined (create-react-app v2.0) #20

sartaj10 opened this issue Oct 19, 2018 · 1 comment

Comments

@sartaj10
Copy link

Hi,

I recently upgraded my project to use the create-react-app v2.0 and I'm getting this error

screen shot 2018-10-19 at 10 51 32 am

The issue seems to be around the fact that with this update, they have removed support for .mjs extensions as seen below

screen shot 2018-10-19 at 10 53 18 am

Here are a couple of links that I found that seem to fix the problem for other packages
facebook/create-react-app#4318
jaredpalmer/razzle@39ea3a6#diff-4fc6a7be00756e3dbc6b0eac82ea10e5R145

NOTE : This worked fine with create-react-app V1.0

@dmt0
Copy link

dmt0 commented Nov 1, 2018

Related: I'm getting the error:

ERROR in ./node_modules/deepcopy/index.mjs
Module not found: Error: Can't resolve './src/index' in '/Users/[...]/webapp/node_modules/deepcopy'```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants