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

Babel Error on start - clean app #8061

Closed
skoliver89 opened this issue Dec 2, 2019 · 15 comments
Closed

Babel Error on start - clean app #8061

skoliver89 opened this issue Dec 2, 2019 · 15 comments

Comments

@skoliver89
Copy link

skoliver89 commented Dec 2, 2019

Describe the bug

I created a new/clean react app and on first run of the start script with no edits I get a Babel Error.
See below for my CLI outout.

$ npx create-react-app price-grid
npx: installed 91 in 6.335s

Creating a new React app in C:\Users\soliver\Documents\react_module_dev\price-grid.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...


> core-js@2.6.10 postinstall C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\babel-runtime\node_modules\core-js
> node postinstall || echo "ignore"


> core-js@3.2.1 postinstall C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\core-js
> node scripts/postinstall || echo "ignore"


> core-js-pure@3.4.7 postinstall C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"

+ react-dom@16.12.0
+ react@16.12.0
+ react-scripts@3.2.0
added 1483 packages from 695 contributors and audited 904941 packages in 50.992s

15 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


Initialized a git repository.

Success! Created price-grid at C:\Users\soliver\Documents\react_module_dev\price-grid
Inside that directory, you can run several commands:

  npm start
    Starts the development server.

  npm run build
    Bundles the app into static files for production.

  npm test
    Starts the test runner.

  npm run eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd price-grid
  npm start

Happy hacking!

soliver@IS-SO-WIN10 MINGW64 /c/Users/soliver/Documents/react_module_dev
$ cd price-grid/

soliver@IS-SO-WIN10 MINGW64 /c/Users/soliver/Documents/react_module_dev/price-grid (master)
$ npm start

> price-grid@0.1.0 start C:\Users\soliver\Documents\react_module_dev\price-grid
> react-scripts start

Starting the development server...

Failed to compile.

./node_modules/react-dev-utils/webpackHotDevClient.js
Error: [BABEL] C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\react-dev-utils\webpackHotDevClient.js: Cannot find module './src/data'
Require stack:
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\core-js-compat\helpers.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\core-js-compat\get-modules-list-for-target-version.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\babel-preset-react-app\node_modules\@babel\preset-env\lib\polyfills\corejs3\entry-plugin.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\babel-preset-react-app\node_modules\@babel\preset-env\lib\index.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\babel-preset-react-app\dependencies.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\@babel\core\lib\config\files\plugins.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\@babel\core\lib\config\files\index.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\@babel\core\lib\index.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\babel-loader\lib\index.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\loader-runner\lib\loadLoader.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\loader-runner\lib\LoaderRunner.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\webpack\lib\NormalModule.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\webpack\lib\NormalModuleFactory.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\webpack\lib\Compiler.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\webpack\lib\webpack.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\react-scripts\scripts\start.js (While processing: "C:\\Users\\soliver\\Documents\\react_module_dev\\price-grid\\node_modules\\babel-preset-react-app\\dependencies.js$0$9")


Did you try recovering your dependencies?

Followed the Recommended fix steps and issue persists.

NPM Version: 6.13.1

Which terms did you search for in User Guide?

'npm start error'
'babel error'
'npm start babel error'

Environment

Environment Info:

  System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Xeon(R) CPU E3-1285 v6 @ 4.10GHz
  Binaries:
    Node: 13.2.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.13.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.18362.449.0
    Internet Explorer: 11.0.18362.1
  npmPackages:
    react: ^16.12.0 => 16.12.0
    react-dom: ^16.12.0 => 16.12.0
    react-scripts: 3.2.0 => 3.2.0
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. run npx create-react-app app-name
  2. enter command cd app-name
  3. enter command npm start

Expected behavior

Opens default react app in browser (no errors)

Actual behavior

Error output in CLI and Browser:
(see description for CLI Error output)
image

Reproducible demo

I didn't change anything from what is provide immediately after running create-react-app

@NielXu
Copy link

NielXu commented Dec 2, 2019

I have the same issue

@im-stuart
Copy link

I experience the same issue. Worked fine a week ago.

@CRHarding
Copy link

Same issue for all 25 of my students.

@Oswirrex
Copy link

Oswirrex commented Dec 2, 2019

Same

@oohwooh
Copy link

oohwooh commented Dec 2, 2019

This is happening to me as well

@bourdakos1
Copy link

Same for me, was working fine 2 hours ago

@lfernando-silva
Copy link

lfernando-silva commented Dec 2, 2019

react-scripts stoped to work for me by this error (as I cleaned the node_modules)

@nicolairhs
Copy link

Same here.

@oohwooh
Copy link

oohwooh commented Dec 2, 2019

Looks like it's because the npm cache hasn't been updated yet, it's a bug in core-js-compat zloirock/core-js#713

should fix itself soon?

@nicolo-ribaudo
Copy link

nicolo-ribaudo commented Dec 2, 2019

The fix has been released 1 hour ago but it isn't downloaded by npm: npm/cli#545
Please 👍 that issue.

@skoliver89
Copy link
Author

Well... isn't that niffty. Thanks for the heads up!

@jawee
Copy link

jawee commented Dec 2, 2019

If you need it to work now and you cant wait for npm to be updated, you can run this:
npm install core-js-compat@3.4.7
It made it work for me at least.

@oohwooh
Copy link

oohwooh commented Dec 2, 2019

if you run npm i -D core-js-compat@3.4.7 it should resolve the problem. Worked for me. parcel-bundler/parcel#3864 (comment)

@skoliver89
Copy link
Author

Sounds like we this issue is out to the hands of this team.
We also have interim fixes provided by @jawee and @DragonBallZeke
Therefore, I am going to close my issue.

Thanks for all of the support my dudes! 😄

@skoliver89
Copy link
Author

just as an update:

Looks like npm got their stuff fixed. It should work now as intended. (I just verified it on my machine)

npm steps:

  1. delete node_modules & package-lock
  2. remove core-js-compat from package.json dependencies if you installed it
  3. run npm install

As the create react app team likes to say... "Happy Hacking!" 😄

@lock lock bot locked and limited conversation to collaborators Dec 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests