Solvedangular cli 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!

Screen Shot 2019-08-31 at 12 42 29

🔬 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! frontend-mallabee@2.0.1 build-dev: `ng build --configuration dev`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the frontend-mallabee@2.0.1 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
37 Answers

✔️Accepted Answer

I was able to fix my build by for the moment changing the tsconfig.app.json target from es2015 back down to es5, this disabled differential loading.

See https://angular.io/guide/deployment#differential-loading

Other Answers:

Hello. It happened to me after upgrading to angular/cli@8.3.21 and angular-devkit/build-angular@0.803.21. Going back to .20 "fixed" the issue.

I was able to fix my build by for the moment changing the tsconfig.app.json target from es2015 back down to es5, this disabled differential loading.

See https://angular.io/guide/deployment#differential-loading

Thanks it works for me

@alan-agius4 Maybe a good way to maintain it (sounds like a good way to improve performance locally) and provide a solution to CI environments with limited resources would be adding an option to angular.json or some other place to determine whether it should run multiple processes to parallelize ES5 bundles generation or not.

@Harika511
In package.json:

  "devDependencies": {
    "@angular-devkit/build-angular": "0.803.20",
    "@angular/cli": "8.3.20",

Note missing "~" or "^" characters.

More Issues: