Create-react-app: Failed to compile after updating to v3.0.0

Created on 23 Apr 2019  路  10Comments  路  Source: facebook/create-react-app

After updating the next dependencies:

...
    "babel-preset-react-app":   "^7.0.2"  => "^8.0.0",
    "react-dev-utils": "^8.0.0" => "^9.0.0",
    "react-scripts": "^2.1.8" => "3.0.0",
...

I'm facing the next error using react lazy api:
Captura de pantalla de 2019-04-23 10-39-10

Most helpful comment

I was having the same problem. Removed yarn.lock and node_modules/ and did a fresh yarn install. This solved for me. Might give it a try.

All 10 comments

I also have a problem after updating "react-scripts": "3.0.0" :

Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Volumes/Workspace/Personal/react-typescript/node_modules/babel-preset-react-app/index.js$0")

That's not the same error, but related to babel-preset-react-app too.

I was having the same problem. Removed yarn.lock and node_modules/ and did a fresh yarn install. This solved for me. Might give it a try.

That's exactly what I just did and it works ! But... I think it's not the good solution, but I may be wrong 馃槄.

Good luck for your problem !

oooh never thought about it. I mean I always remove the node_modules/ and the package-lock.json just in case, but didn't remove the yarn.lock. I did a rollback of everything to be able to work. I'll try later with that solutions guys; even if it is not the best solution but it might work like did for you. Thanks! :)

Also encountering this problem. In one project I have rm -rf node_modules && npm install works (doesn't use package-lock.json) yet in another project that _does_ use package-lock.json doing rm package-lock.json && rm -rf node_modules && npm install does _not_ fix this issue. It's complaining about any places where I have dynamic imports (i.e. import()).

We have hit this issue as well and it seemed to be related to a change in acorn-dynamic-import package.

image

image

We had to manually change our package-lock.json to get a build. Deleting the lock file didn't work for us either.
Could be linked to this webpack issue: https://github.com/webpack/webpack/issues/8656
And maybe this one: https://github.com/acornjs/acorn/issues/809

@andybarsby looks like you found the issue! Changing the package-lock wasn't really an option in the failing project, so I installed acorn-dynamic-import@3 to devDependencies and ran a build and it worked. So 馃this works when it heads up to the CI. Thanks for the tip.

I couldn't compile and start the app after I upgraded react-scripts to v3.0.1.
I've removed node_modules and installing them again and this have solved the problem for me.

Closing as a dupe of #6673.

Thanks @kylehalleman and @andybarsby , this is the only solution that have worked for me! I've been having this issue since the 3.0 alpha/beta. I will try to suggest this as a fix in #6673

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adrice727 picture adrice727  路  3Comments

Evan-GK picture Evan-GK  路  3Comments

onelson picture onelson  路  3Comments

ap13p picture ap13p  路  3Comments

rdamian3 picture rdamian3  路  3Comments