create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Build fails: Could not find plugin "proposal-numeric-separator"

Open muehlbaueralex opened this issue 6 years ago • 79 comments

Describe the bug

Running npm run build will fail on any project, even on a vanilla app created with create-react-app will fail with the following error:

Error: [BABEL] /Users/<username>/Projects/my-app/src/index.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "/Users/<username>/Projects/my-app/node_modules/babel-preset-react-app/index.js$0")
    at Array.map (<anonymous>)
    at Generator.next (<anonymous>)
    at Generator.next (<anonymous>)


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

From our build pipelines I can tell it started roughly around Mar 20, 2020 4:48pm GMT+0100

Did you try recovering your dependencies?

I tried recovering the module tree and even verified with a vanilla app. It happens on my local machine and on our build machines with no changes involved there.

$ npm --version
6.13.1

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

$ npx create-react-app --info

Environment Info:

  System:
    OS: macOS 10.15.3
    CPU: (8) x64 Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
  Binaries:
    Node: 13.2.0 - /usr/local/bin/node
    Yarn: 1.19.2 - /usr/local/bin/yarn
    npm: 6.13.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 80.0.3987.149
    Firefox: 68.0.2
    Safari: 13.0.5
  npmPackages:
    react: ^16.13.1 => 16.13.1
    react-dom: ^16.13.1 => 16.13.1
    react-scripts: 3.4.0 => 3.4.0
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. npx create-react-app my-app
  2. cd my-app
  3. npm run build

Expected behavior

The build is successful with no error.

Reproducible demo

As mentioned in the above sections a vanilla app is enough to reproduce.

  1. npx create-react-app my-app
  2. cd my-app
  3. npm run build

muehlbaueralex avatar Mar 20 '20 16:03 muehlbaueralex

This started affecting my team as well

rosbel avatar Mar 20 '20 17:03 rosbel

Same here

Volosh1n avatar Mar 20 '20 17:03 Volosh1n

Possible related to new babel-loader release (about 2 hours ago) ref: https://github.com/babel/babel-loader/releases

adascal avatar Mar 20 '20 17:03 adascal

affecting me as well.

floofydoug avatar Mar 20 '20 17:03 floofydoug

me too

PFadel avatar Mar 20 '20 17:03 PFadel

me too

Binbiubiubiu avatar Mar 20 '20 17:03 Binbiubiubiu

Hey everyone, thumbs up the original post. Adding "me too" just becomes noise to the maintainers

gonzofish avatar Mar 20 '20 17:03 gonzofish

This bug was fixed in Babel by https://github.com/babel/babel/pull/11201, and here once https://github.com/facebook/create-react-app/pull/8620 gets released.

existentialism avatar Mar 20 '20 17:03 existentialism

Thanks @existentialism! Is there any solution/workaround in the meantime?

gonzofish avatar Mar 20 '20 17:03 gonzofish

I’m using [email protected], but still have the issue

marvelousdev0 avatar Mar 20 '20 17:03 marvelousdev0

Ejecting and updating the babel dependency would be a way of fixing this in the meantime.

MKrupauskas avatar Mar 20 '20 17:03 MKrupauskas

+1

MMachado-uy avatar Mar 20 '20 17:03 MMachado-uy

affecting me as well.

apipemc avatar Mar 20 '20 17:03 apipemc

I am getting the same error when building angular 8 app in azure deveops pipeline

"An unhandled exception occurred: [BABEL] D:\a\1\s\dist\web\main-es2015.02f4b8f684805898bcff.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "D:\a\1\s\node_modules\@babel\preset-env\lib\index.js")

m-malik15 avatar Mar 20 '20 17:03 m-malik15

+1

jayc13 avatar Mar 20 '20 17:03 jayc13

Same problem here

daviguelfi avatar Mar 20 '20 18:03 daviguelfi

For quick fix you can eject and downgrade babel-preset-react-app to 9.0.0(maybe more recent will work too)

Do you have a link on how I can achieve this? New to React/Node.

anthonyikeda avatar Mar 20 '20 18:03 anthonyikeda

For quick fix you can eject and downgrade babel-preset-react-app to 9.0.0(maybe more recent will work too)

Do you have a link on how I can achieve this? New to React/Node.

  1. npm run eject
  2. Open package.json and set "babel-preset-react-app": "9.0.0" (note: use exactly "9.0.0", not "^9.0.0")
  3. npm i

Lukavyi avatar Mar 20 '20 18:03 Lukavyi

The issue is still reproduced

kuhel avatar Mar 20 '20 18:03 kuhel

~~Quick fix: Downgrading to "react-scripts": "^2.1.5", worked for my team!! No ejection necessary~~

EDIT: update thanks to @mohsenari:

I strongly suggest not using this as it results in 88 vulnerabilities from npm audit. added 1940 packages from 744 contributors and audited 40593 packages in 44.492s found 88 vulnerabilities (81 low, 2 moderate, 5 high)

rachelruderman avatar Mar 20 '20 18:03 rachelruderman