angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Error | Could not find plugin "proposal-numeric-separator" | Generating ES5 bundles for differential loading

Open vegarda opened this issue 6 years ago β€’ 85 comments

🐞 Bug report

Command (mark with an x)

  • [ ] new
  • [x] build
  • [ ] serve
  • [ ] test
  • [ ] e2e
  • [ ] generate
  • [ ] add
  • [ ] update
  • [ ] lint
  • [ ] xi18n
  • [ ] run
  • [ ] config
  • [ ] help
  • [ ] version
  • [ ] doc

Is this a regression?

Yes, the previous version in which this bug was not present was: a few hours ago

Description

A clear and concise description of the problem...

Build doesn't work

πŸ”¬ Minimal Reproduction


npm install
node --max-old-space-size=4096 ./node_modules/@angular/cli/bin/ng build --prod

πŸ”₯ Exception or Error



Generating ES5 bundles for differential loading...
An unhandled exception occurred: [BABEL] C:\angular\dist\common-es2015.b1722ef05b43f664abc2.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "C:\\angular\\node_modules\\@angular-devkit\\build-angular\\node_modules\\@babel\\preset-env\\lib\\index.js")
See "C:\Users\Vegard\AppData\Local\Temp\ng-J7YoSB\angular-errors.log" for further details.

🌍 Your Environment


Angular CLI: 8.3.25
Node: 12.14.1
OS: win32 x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic
... platform-webworker, platform-webworker-dynamic, router
... service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.25
@angular-devkit/build-angular     0.803.25
@angular-devkit/build-optimizer   0.803.25
@angular-devkit/build-webpack     0.803.25
@angular-devkit/core              8.3.25
@angular-devkit/schematics        8.3.25
@angular/cdk                      8.2.3
@angular/cli                      8.3.25
@angular/material                 8.2.3
@angular/pwa                      0.803.25
@ngtools/webpack                  8.3.25
@schematics/angular               8.3.25
@schematics/update                0.803.25
rxjs                              6.5.4
typescript                        3.5.3
webpack                           4.39.2



Anything else relevant?

https://github.com/facebook/create-react-app/issues/8680

vegarda avatar Mar 20 '20 21:03 vegarda

CHANGING "@angular-devkit/build-angular": "^0.803.25" TO "@angular-devkit/build-angular": "0.803.23"

worked for me

alexnoise79 avatar Mar 23 '20 09:03 alexnoise79

Try to install "@babel/compat-data": "~7.8.0" to devDependencies. This is the only workaround which helped me.

Thank god. This works. Angular Team please help in fixing this issue from angular cli end.

mohanramphp avatar Mar 23 '20 10:03 mohanramphp

working

"@babel/compat-data": "7.8.0"

not working

"@babel/compat-data": "7.9.0"

splincode avatar Mar 23 '20 13:03 splincode

Verified that it was a Babel bug introduced 3 days ago. https://github.com/babel/babel/pull/11201 https://www.npmjs.com/package/@babel/preset-env Lock down the versions of Babel’s packages using the tilde instead of the caret: "dependencies": { "@babel/preset-env": "~7.8.7", "@babel/compat-data": "~7.8.6",

kkilton avatar Mar 23 '20 20:03 kkilton

Hi kkilton, may I ask you how to do this lockdown? Is it equivalent procedure than the one given by Lakshitha Perera but for preset-env and compat-data ?

ghost avatar Mar 23 '20 21:03 ghost

Hi kkilton, may I ask you how to do this lockdown? Is it equivalent procedure than the one given by Lakshitha Perera but for preset-env and compat-data ?

stchln, I didn't need to do all the extra steps that Lakshitha did (although I tried and it didn't work for me) I just updated the dependencies in the package.config. The tilde's are what's important. The caret will allow the versions to go up to minor 7.9.999 (which is where the problem is, minor version 9) where the tilde only allows the patch version to increase up to 7.8.999... You could also remove the tilde and caret completely until Babel gets a fix deployed. Hope this helps.

kkilton avatar Mar 23 '20 21:03 kkilton

Will try, thanks a lot

ghost avatar Mar 23 '20 21:03 ghost

Try to install "@babel/compat-data": "~7.8.0" to devDependencies. This is the only workaround which helped me.

This procedure, break the compilation of es5 files in ionic for old webview system and older phone! Resulting in Blank White Screen! screenshot_725

Ruslancic avatar Mar 24 '20 01:03 Ruslancic

WORKARROUND On package.json add

  "resolutions": {
    "@babel/preset-env": "^7.8.7",
    "@babel/compat-data": "~7.8.0"
  }

run npx npm-force-resolutions then run npm install or yarn then run npm build or yarn build

NewtonMan avatar Mar 24 '20 02:03 NewtonMan

WORKARROUND On package.json add

  "resolutions": {
    "@babel/preset-env": "^7.8.7",
    "@babel/compat-data": "~7.8.0"
  }

run npx npm-force-resolutions then run npm install or yarn then run npm build or yarn build

Tried this and work on first try

jazarie2 avatar Mar 24 '20 05:03 jazarie2

This is not working for me, I still have the painful error on @babel/plugin-proposal-numeric-separator while in my package-lock.json I see compat-data 7.8.6 and preset-env 7.8.7

npm ls @babel/preset-env gives visual@ c:... β€” @babel/[email protected]

npm ls @babel/compat-data visual@ ... +β€” @babel/[email protected] Λ‹β€” @babel/[email protected] +β€” @babel/[email protected] deduped Β΄β€” @babel/[email protected] Β΄@babel/[email protected]

ghost avatar Mar 24 '20 07:03 ghost

@jazarie2 just tried what you suggest and I can go up to npm build, thanks but then when, as sampleRHTMLVisual demo I am trying to build, I am requested to have @babel/plugin-proposal-numeric-separator when launching pbiviz package...

ghost avatar Mar 24 '20 07:03 ghost

And If I do a npm install β€”save-dev @babel/plugin-proposal-numeric-separator I get a warning that the plugin required a peer of @babel/core@^7.0.0-0 but none is installed

ghost avatar Mar 24 '20 07:03 ghost

@stchln can you try and delete your node_module/@babel folder and then run npm install? I went down the route of trying to install the proposal-numeric-separator but ended up reverting that and didn't need it in the end. Your package-lock.json looks fine from the ls cmd but maybe try and delete it and re-gen it with npm install --package-lock?

kkilton avatar Mar 24 '20 14:03 kkilton

working

"@babel/compat-data": "7.8.0"

not working

"@babel/compat-data": "7.9.0"

that worked for me thanks

MustafaMohamed2018 avatar Mar 24 '20 14:03 MustafaMohamed2018

WORKARROUND On package.json add

  "resolutions": {
    "@babel/preset-env": "^7.8.7",
    "@babel/compat-data": "~7.8.0"
  }

run npx npm-force-resolutions then run npm install or yarn then run npm build or yarn build

Tried this and also worked on first try

datazen avatar Mar 24 '20 15:03 datazen

Same here

working

"@babel/compat-data": "7.8.0"

not working

"@babel/compat-data": "7.9.0"

that worked for me thanks

lopezbertoni avatar Mar 24 '20 17:03 lopezbertoni

CHANGING "@angular-devkit/build-angular": "^0.803.25" TO "@angular-devkit/build-angular": "0.803.23"

worked for me

This worked for me. No problem with angular ng build.

burdokat avatar Mar 24 '20 23:03 burdokat

WORKARROUND On package.json add

  "resolutions": {
    "@babel/preset-env": "^7.8.7",
    "@babel/compat-data": "~7.8.0"
  }

run npx npm-force-resolutions then run npm install or yarn then run npm build or yarn build

This also worked for me on the first try. Thank you for the solution!

willr79 avatar Mar 25 '20 00:03 willr79

The above "WORKARROUND" worked for me.

fritzwf avatar Mar 25 '20 00:03 fritzwf