Build fails: Could not find plugin "proposal-numeric-separator"
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
npx create-react-app my-appcd my-appnpm 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.
npx create-react-app my-appcd my-appnpm run build
This started affecting my team as well
Same here
Possible related to new babel-loader release (about 2 hours ago)
ref: https://github.com/babel/babel-loader/releases
affecting me as well.
me too
me too
Hey everyone, thumbs up the original post. Adding "me too" just becomes noise to the maintainers
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.
Thanks @existentialism! Is there any solution/workaround in the meantime?
I’m using [email protected], but still have the issue
Ejecting and updating the babel dependency would be a way of fixing this in the meantime.
+1
affecting me as well.
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")
+1
Same problem here
For quick fix you can eject and downgrade
babel-preset-react-appto9.0.0(maybe more recent will work too)
Do you have a link on how I can achieve this? New to React/Node.
For quick fix you can eject and downgrade
babel-preset-react-appto9.0.0(maybe more recent will work too)Do you have a link on how I can achieve this? New to React/Node.
npm run eject- Open package.json and set
"babel-preset-react-app": "9.0.0"(note: use exactly "9.0.0", not "^9.0.0") npm i
The issue is still reproduced
~~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)