Newly created applications experienced a brief disruption between 8:15 PM - 9:15 PM (EST). The issue is now resolved.
Please delete the
node_modulesdirectory and then runnpm install.
If using yarn, you only need to runyarn upgrade.
Yes
I created a new app with create-react-app and I'm not able to run it. I can create a production build just fine and run that, but the development build doesn't work.
Here is the error I'm receiving in the terminal / browser:
Failed to compile.
Error in ./src/index.js
Module build failed: TypeError: /home/connor/git/Wakonda/src/index.js: Cannot read property 'scope' of undefined
@ multi main
And here's what I see when I open the console:
Uncaught Error: Cannot find module "/home/connor/git/cra-bug/src/index.js"
at webpackMissingModule (bootstrap 2a26695…:578)
at Object.<anonymous> (bootstrap 2a26695…:578)
at __webpack_require__ (bootstrap 2a26695…:555)
at bootstrap 2a26695…:578
at bootstrap 2a26695…:578
Run these commands in the project folder and fill in their results:
npm ls react-scripts (if you haven’t ejected):└── [email protected]node -v:v7.5.0npm -v:4.1.2If it makes any difference, I was using Yarn, but I also tested installing dependencies via npm and got the same issue.
Edit: I also tried this in Windows 10, and I receive the same error.
Then, specify:
I'm getting the same error.
Environment:
node v7.2.1
OSX El Capitan 10.11.5
I think it has to do with the version of babel-core used.
I fixed it by:
I'm getting the same error
Environment:
node -v
v7.4.0
npm -v
4.2.0
Operating System: macOS Sierra v10.12.3
I had the same error too.
Just update babel in your project using this command:
npm install --save-dev babel-core
References:
ModuleBuildError: Module build failed: TypeError: Cannot read property 'scope' of undefined
Fix bug - undefined reference for export declaration
@ajeremias - that _did_ work for me, thanks for the tip! 👍
If anyone needs a temporary solution - that's it.
This is broken for me as well.
Error in ./src/index.js
Module build failed: TypeError: /Users/**/Documents/node/projects/hello-world/src/index.js: Cannot read property 'scope' of undefined
@ multi main
@ajeremias - that worked for me, too! Didn't need to eject.
We inadvertently released a backwards incompatible change in babel-traverse.
We just reverted it and released a fix (6.23.1) that should fix this issue. Please reinstall deps. Sorry for the inconvenience!
It could be related to https://github.com/babel/babel/issues/5305.
Sorry for the trouble everyone! Perhaps now is the time to reignite our Yarn discussions.
Thanks for looking into it!
I've opened an issue about this here so we can try to prevent this from happening in the future: https://github.com/facebookincubator/create-react-app/issues/1551
Most helpful comment
I had the same error too.
Just update babel in your project using this command:
npm install --save-dev babel-coreReferences:
ModuleBuildError: Module build failed: TypeError: Cannot read property 'scope' of undefined
Fix bug - undefined reference for export declaration