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

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

keitoaino avatar Mar 20 '20 23:03 keitoaino

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

This is don't work for me...

dex252 avatar Mar 21 '20 08:03 dex252

Hi, all @vegarda, @dex252 I have the issue as well, but i managed to find single working set of package(s)

"@angular-devkit/build-angular": "^0.803.23", "@angular/cli": "~8.3.22",

I believe the you need to use lower version of @angular-devkit/build-angular rather then 0.803.25

azhukov87 avatar Mar 21 '20 10:03 azhukov87

I was able to build by disabling generating ES5 bundles for differential loading by setting

"browserslist": [
    "last 2 Chrome versions"
]

in packages.json, and

"es5BrowserSupport": false

in angular.json

vegarda avatar Mar 21 '20 12:03 vegarda

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

This also worked for me. I was getting this error when building an image for an Angular 8 Universal app with docker. I also followed the steps listed in this react thread to use npm resolutions. https://github.com/facebook/create-react-app/issues/8680. Not sure if the resolutions step is needed because it wasn't until I added @babel/compat-data to my devDependencies that the issue was resolved. I would first just try adding @babel/compat-data to devDependencies.

mattcwebster avatar Mar 21 '20 15:03 mattcwebster

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

This also worked for me. I want to add that the error didn't show up locally, but only when i used Azure Devops. I think DevOps bumps up the babel versions

judedaryl avatar Mar 21 '20 15:03 judedaryl

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

this(npm i @babel/[email protected]) works for me! thanks @keitoaino

OyebisiJemil avatar Mar 21 '20 16:03 OyebisiJemil

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

This also worked for me. Be sure to use exactly this version. Pay attention to the version. Firstly I automatically installed "@babel/compat-data": "^7.9.0" - this didn't work

SergeyMell avatar Mar 21 '20 16:03 SergeyMell

@judedaryl this could be also related to package-lock.json - if it's ignored (eg using npm i instead of npm ci) then remote CI could be affected by this issue.

keitoaino avatar Mar 21 '20 16:03 keitoaino

just installing "@babel/compat-data": "7.8.0" didn't work for me. I had to delete the package-lock.json file

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

This is don't work for me...

farajfarook avatar Mar 21 '20 18:03 farajfarook

Sticking to previous version of build-angular just do the work without any other change (and "@babel/compat-data": "7.8.0" did not work for me, with or without removing the lock)

"devDependencies": {
    "@angular-devkit/build-angular": "=0.803.22",
    ...
}

ghost avatar Mar 21 '20 19:03 ghost

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

This worked for me. Is this considered a temporary solution? Should we keep a watch on this and remove it later?

maurimorinelli avatar Mar 21 '20 20:03 maurimorinelli

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

Rocks!

zraees avatar Mar 21 '20 21:03 zraees

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

Worked for me!! Do we need to remove it manually after the fix or will be handled in the internal devDependencies?

nchakravarthi avatar Mar 22 '20 00:03 nchakravarthi

@morinellipy @gs-nchakravarthi yes, we need to keep this only until issue will be fixed. Then it will be needed to remove @babel/compat-data dependency from host website and update @angular-devkit/build-angular (see https://github.com/angular/angular-cli/pull/17267)

keitoaino avatar Mar 22 '20 01:03 keitoaino

"@babel/compat-data": "~7.8.0" suggestion from the comment above solved the problem. I believe it will be fixed soon since the issue has been reported yesterday.

gustavohks2 avatar Mar 22 '20 01:03 gustavohks2

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

this(npm i @babel/[email protected]) works for me! thanks @keitoaino

Thanks men this is also work for me

vajidaliji avatar Mar 22 '20 06:03 vajidaliji

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

This also worked for me. I was getting this error when building an image for an Angular 8 Universal app with docker. I also followed the steps listed in this react thread to use npm resolutions. facebook/create-react-app#8680. Not sure if the resolutions step is needed because it wasn't until I added @babel/compat-data to my devDependencies that the issue was resolved. I would first just try adding @babel/compat-data to devDependencies.

I'm using nrwl workspace with angular@^8.2.0(the angular cli version is 8.3.14 in the yarn.lock) and I having the same issue.

I've tried all the work arounds under this thread and none of them works for me, not until I tried adding resolutions in my package.json file.

"resolutions": {
    "@babel/preset-env": "^7.8.7"
},

See: create-react-app Issue #8860

I hope this will help someone who still having issue after trying all above, like me. And I'm looking forward for the fix.

Roman-Lo avatar Mar 22 '20 13:03 Roman-Lo

The problem is preseent also with angular 8 [INFO] Generating ES5 bundles for differential loading... [INFO] An unhandled exception occurred: [BABEL] /var/lib/jenkins/workspace/dgkoro1_0/dg-suite-client/dist/dg-suite/polyfills-es5.42ee81f782be21ac5c8b.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "/var/lib/jenkins/workspace/dgkoro1_0/dg-suite-client/node_modules/@babel/preset-env/lib/index.js") [INFO] See "/tmp/ng-QZa8t9/angular-errors.log" for further details. [INFO] npm ERR! code ELIFECYCLE [INFO] npm ERR! syscall spawn [INFO] npm ERR! file sh [INFO] npm ERR! errno ENOENT [INFO] npm ERR! [email protected] build-svil: ng build --configuration=svil && node usestrictfixer.js [INFO] npm ERR! spawn ENOENT [INFO] npm ERR! [INFO] npm ERR! Failed at the [email protected] build-svil script. [INFO] npm ERR! This is probably not a problem with npm. There is likely additional logging output above. [INFO] [INFO] npm ERR! A complete log of this run can be found in: [INFO] npm ERR! /var/lib/jenkins/.npm/_logs/2020-03-23T07_48_51_372Z-debug.log

lchiesa2000 avatar Mar 23 '20 08:03 lchiesa2000

Use these Steps to Fix the Issue

  1. delete node_modules and package-lock.json

  2. add "resolutions": { "@babel/preset-env": "^7.8.7" } to package.json

  3. npm install npm-force-resolutions --save-dev

  4. npm install

  5. npx npm-force-resolutions

  6. npm install again

  7. ionic build , ionic cordova run android

lakshitha1629 avatar Mar 23 '20 08:03 lakshitha1629