question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Babel Error on start - clean app

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:20
  • Comments:15

github_iconTop GitHub Comments

6reactions
oohwoohcommented, Dec 2, 2019

Looks like it’s because the npm cache hasn’t been updated yet, it’s a bug in core-js-compat https://github.com/zloirock/core-js/issues/713

should fix itself soon?

4reactions
oohwoohcommented, Dec 2, 2019

if you run npm i -D core-js-compat@3.4.7 it should resolve the problem. Worked for me. https://github.com/parcel-bundler/parcel/issues/3864#issuecomment-560541229

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with babel-jest dependency when running npm start in a ...
First of all, read the error message in the cmd from the beginning. They'll tell you what module is causing the problem. ·...
Read more >
Babel error while running npm start - M220JS - MongoDB
[nodemon] app crashed - waiting for file changes before starting… TLDR; - You appear to have a dependency issue. Clean install the project....
Read more >
Module not found: Can't resolve 'babel-loader' | bobbyhadz
To solve the error Module not found: Error: Can't resolve 'babel-loader', ... Open your terminal in your project's root directory (where your package.json ......
Read more >
Installation | React Native Reanimated - Software Mansion
Add Reanimated's Babel plugin to your babel.config.js : module.exports = { ... In most cases, this can be fixed by cleaning the application's...
Read more >
How I solved and debugged my Webpack issue through trial ...
I created everything so that I could start coding and add my new components to my shiny new component library. But what if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found