An unhandled exception while Generating ES5 bundles
🐞 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 8.2.1, maybe 8.2.2
Description
When using ng build in circle ci, it throws an error (screenshot attached):
Generating ES5 bundles for differential loading...
An unhandled exception occurred: cancel after 1 retries!
🔬 Minimal Reproduction
Unfortunately, I cant provide a way to reproduce it as it happens only in CI and I am unable to get the logs. I think it's related to the size of my app but I cant be sure.
🔥 Exception or Error
WARNING in budgets, maximum exceeded for initial. Budget 2 MB was exceeded by 2.2 MB.
Generating ES5 bundles for differential loading...
An unhandled exception occurred: cancel after 1 retries!
See "/tmp/ng-8Tr7C1/angular-errors.log" for further details.
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] build-dev: `ng build --configuration dev`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] build-dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/circleci/.npm/_logs/2019-08-31T09_20_07_881Z-debug.log
Exited with code 1
🌍 Your Environment
@angular-devkit/architect 0.803.2
@angular-devkit/build-angular 0.803.2
@angular-devkit/build-optimizer 0.803.2
@angular-devkit/build-webpack 0.803.2
@angular-devkit/core 8.3.2
@angular-devkit/schematics 8.3.2
@angular/cdk 8.1.4
@angular/cli 8.3.2
@angular/flex-layout 8.0.0-beta.27
@angular/material 8.1.4
@ngtools/webpack 8.3.2
@schematics/angular 8.3.2
@schematics/update 0.803.2
rxjs 6.5.2
typescript 3.5.3
webpack 4.39.2
In our case, we are only supporting modern browsers and using Angular 9, so what worked for me is modifying the browserlist file to only have Chrome >= 61. See this SO answer.
Edit: I wanted to ensure that down the road other browsers were also considered so I modified my browserlist like so:
last 2 Chrome versions
last 2 ChromeAndroid versions
last 2 Safari versions
last 2 iOS versions
last 2 Firefox versions
last 2 FirefoxAndroid versions
last 2 Edge versions
@clydin and @vikerman this is still failing for me with a large project I have 6656 for memory on the node process and my project is currently using v9.0.0-rc.6 so I believe your fixes should be visible yet it's still failing the same way. I've attached one of the stack traces in case that helps. Stacktrace gist
@paullryan Can you open a new issue describing the problem you are encountering? If possible please include the full output of ng version, the build command used, the relevant sections of the configuration file for the used build command (build options & configuration options), and also the console output of the build command with different loading disabled. You should be able to use a temporary browserslist file with only Chrome 75 for the later.
@clydin I realized it was because the prod flag was not being recognized by the build system that was failing so sorry for the the false alarm, thanks for the response but no need for a new issue.
Adding this to my package.json solved for me:
"browserslist" : [ ],
This worked in conjunction with removing the file browserslist
Hello. It happened to me after upgrading to angular/[email protected] and angular-devkit/[email protected]. Going back to .20 "fixed" the issue.
Hello. It happened to me after upgrading to angular/[email protected] and angular-devkit/[email protected]. Going back to .20 "fixed" the issue. How to go back to .20. please clarify me
@Harika511 In package.json:
"devDependencies": {
"@angular-devkit/build-angular": "0.803.20",
"@angular/cli": "8.3.20",
Note missing "~" or "^" characters.
@robelcik many many thanks
Definetely started hanging on differential loading for me after I ran npm audit fix yesterday, which updated @angular-devkit/build-angular from ^0.802.2 to ^0.803.21. If I roll back to 0.802.2 I can build again. Even 0.803.0 doesn't work.
i use angular 8.2.10, install latest nodejs solved my problem. no need to change anything :)
I use angular 8.2.10, upgrade nodejs to v12.14.0 solved my problem.
run cmd ionic cordova run android --prod should work .. have a good day ;)
Hi bdiriamine,
I had so so so much errors and ionic cordova build --release android nothing helped... IONIC Should know (I am using IONIC 5) for the Mobile app to release something hassle free... Your Answer saved me from two days Work.... Thank you so so so much. The Built the APP as you said.
ionic cordova run android --prod
Happy New year Cheers.
Thank you
@Harika511 In package.json:
"devDependencies": { "@angular-devkit/build-angular": "0.803.20", "@angular/cli": "8.3.20",
This worked for me also. I also noticed that removing any modules that referenced "ngx-bootstrap" caused the problem to go away.
Hello. It happened to me after upgrading to angular/[email protected] and angular-devkit/[email protected]. Going back to .20 "fixed" the issue._
thnx mate, this worked for me.
- using newest node version (
12.14.0) didn't work for me - solution for now is to go back to old dev-deps:
"devDependencies": {
"@angular-devkit/build-angular": "0.803.20",
"@angular/cli": "8.3.20",
- increasing the memory
node --max_old_space_size=12000also works as a workaround
Updating node to 12.14.0 worked for me with the latest build-angular and cli packages. Thanks.
After updating to 8.3.21, I also have this issue but only for non production issues. When building with ng build --prod , node doesn't run out of memory. (Using node v12.14.0)
Same issue for me. Can we get this issue reopened or is there another issue tracking it? This must be affecting most users.