angular: ngcc crashing on every CI build

๐Ÿž bug report

Affected Package

The issue is caused by package @angular/compiler-cli - specifically `ngcc`

Is this a regression?

Yes, the previous version in which this bug was not present was: 9.0 (or maybe 8.2)

Description

when ngcc runs on circle-ci it fails every time, but if I SSH into the container and run ngcc it completes successfully.

๐Ÿ”ฌ Minimal Reproduction

https://github.com/paustint/test-ivy-app

Example failing builds: https://app.circleci.com/pipelines/github/paustint/test-ivy-app/1/workflows/e3719bbe-f02c-40c0-8f6f-40c7e61f09ef/jobs/1

https://app.circleci.com/pipelines/github/paustint/test-ivy-app/1/workflows/e3719bbe-f02c-40c0-8f6f-40c7e61f09ef/jobs/2

Note This fails 100% of the time, but fails while compiling seemingly different packages (e.x. it is not consistently failing while compiling any specific package.

๐Ÿ”ฅ Exception or Error


Debug: Forking unlocker child-process
Debug: Attemping to write lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ with PID 192
Debug: Written lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ with PID 192
Debug: Running ngcc on ClusterExecutor (using 8 worker processes).
Debug: Analyzing entry-points...
Debug: No manifest found for /home/circleci/app/node_modules so walking the directories for entry-points.
Debug: Starting unlocker at process 199 on behalf of process 192
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug: Walking directories took 0.5s.
Debug: Invalid entry-point /home/circleci/app/node_modules/@angular/common/upgrade. It is missing required dependencies:
 - @angular/upgrade/static
Debug: Invalid entry-point /home/circleci/app/node_modules/@angular/router/upgrade. It is missing required dependencies:
 - @angular/upgrade/static
Debug: Analyzed 51 entry-points in 2.1s. (Total tasks: 255)
Debug: Processing tasks...
Debug: Spawning another worker process as there is more work to be done.
Debug: Spawning another worker process as there is more work to be done.
Debug: Spawning another worker process as there is more work to be done.
Debug: Spawning another worker process as there is more work to be done.
Debug: Spawning another worker process as there is more work to be done.
Debug: No assignments for 1 idle (out of 6 total) workers. Busy workers: 1, 2, 3, 4, 5
Debug: Forking unlocker child-process
Debug: [Worker #1] Processing task: {entryPoint: @angular/core, formatProperty: fesm2015, processDts: true}
Debug: Forking unlocker child-process
Debug: [Worker #2] Processing task: {entryPoint: @angular/animations, formatProperty: fesm2015, processDts: true}
Debug: Forking unlocker child-process
Debug: [Worker #3] Processing task: {entryPoint: @angular/cdk/keycodes, formatProperty: fesm2015, processDts: true}
Debug: Forking unlocker child-process
Debug: [Worker #4] Processing task: {entryPoint: @angular/compiler/testing, formatProperty: fesm2015, processDts: true}
Debug: Forking unlocker child-process
Debug: Forking unlocker child-process
Debug: [Worker #5] Processing task: {entryPoint: @angular/service-worker/config, formatProperty: fesm2015, processDts: true}
Debug: Starting unlocker at process 248 on behalf of process 206
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug: Starting unlocker at process 255 on behalf of process 213
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug: Starting unlocker at process 262 on behalf of process 220
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug: Starting unlocker at process 269 on behalf of process 227
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug: Starting unlocker at process 277 on behalf of process 234
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug: Starting unlocker at process 276 on behalf of process 241
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Compiling @angular/cdk/keycodes : fesm2015 as esm2015
Compiling @angular/animations : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/keycodes : fesm2015
Debug: Spawning another worker process as there is more work to be done.
Debug: [Worker #3] Processing task: {entryPoint: @angular/cdk/keycodes, formatProperty: fesm5, processDts: false}
Debug: [Worker #6] Processing task: {entryPoint: @angular/cdk/keycodes, formatProperty: esm2015, processDts: false}
Debug: Spawning another worker process as there is more work to be done.
Compiling @angular/service-worker/config : fesm2015 as esm2015
Debug:   Successfully compiled @angular/animations : fesm2015
Debug: Spawning another worker process as there is more work to be done.
Debug: [Worker #2] Processing task: {entryPoint: @angular/animations, formatProperty: fesm5, processDts: false}
Debug: All 8 workers are currently busy and cannot take on more work.
Debug:   Successfully compiled @angular/service-worker/config : fesm2015
Debug: All 8 workers are currently busy and cannot take on more work.
Debug: [Worker #5] Processing task: {entryPoint: @angular/animations, formatProperty: esm5, processDts: false}
Debug: All 9 workers are currently busy and cannot take on more work.
Compiling @angular/cdk/keycodes : fesm5 as esm5
Compiling @angular/compiler/testing : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/keycodes : fesm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #3] Processing task: {entryPoint: @angular/cdk/keycodes, formatProperty: main, processDts: false}
Compiling @angular/animations : fesm5 as esm5
Debug:   Successfully compiled @angular/compiler/testing : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #4] Processing task: {entryPoint: @angular/compiler/testing, formatProperty: fesm5, processDts: false}
Debug:   Successfully compiled @angular/animations : fesm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #2] Processing task: {entryPoint: @angular/compiler/testing, formatProperty: esm2015, processDts: false}
Compiling @angular/animations : esm5 as esm5
Debug:   Successfully compiled @angular/animations : esm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #5] Processing task: {entryPoint: @angular/compiler/testing, formatProperty: esm5, processDts: false}
Debug: Forking unlocker child-process
Debug: [Worker #7] Processing task: {entryPoint: @angular/cdk/keycodes, formatProperty: esm5, processDts: false}
Compiling @angular/cdk/keycodes : esm2015 as esm2015
Debug: Forking unlocker child-process
Debug: Forking unlocker child-process
Compiling @angular/cdk/keycodes : main as umd
Debug: [Worker #8] Processing task: {entryPoint: @angular/animations, formatProperty: esm2015, processDts: false}
Debug: [Worker #9] Processing task: {entryPoint: @angular/animations, formatProperty: main, processDts: false}
Debug:   Successfully compiled @angular/cdk/keycodes : esm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #6] Processing task: {entryPoint: @angular/compiler/testing, formatProperty: main, processDts: false}
Debug:   Successfully compiled @angular/cdk/keycodes : main
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #3] Processing task: {entryPoint: @angular/service-worker/config, formatProperty: fesm5, processDts: false}
Debug: Starting unlocker at process 316 on behalf of process 295
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Compiling @angular/compiler/testing : fesm5 as esm5
Debug: Starting unlocker at process 323 on behalf of process 302
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug:   Successfully compiled @angular/compiler/testing : fesm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #4] Processing task: {entryPoint: @angular/service-worker/config, formatProperty: esm2015, processDts: false}
Debug: Starting unlocker at process 324 on behalf of process 309
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Compiling @angular/service-worker/config : fesm5 as esm5
Debug:   Successfully compiled @angular/service-worker/config : fesm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #3] Processing task: {entryPoint: @angular/service-worker/config, formatProperty: esm5, processDts: false}
Compiling @angular/cdk/keycodes : esm5 as esm5
Compiling @angular/service-worker/config : esm2015 as esm2015
Debug:   Successfully compiled @angular/service-worker/config : esm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #4] Processing task: {entryPoint: @angular/service-worker/config, formatProperty: main, processDts: false}
Debug:   Successfully compiled @angular/cdk/keycodes : esm5
Debug: No assignments for 1 idle (out of 9 total) workers. Busy workers: 1, 2, 3, 4, 5, 6, 8, 9
Compiling @angular/animations : main as umd
Compiling @angular/animations : esm2015 as esm2015
Compiling @angular/compiler/testing : main as umd
Compiling @angular/service-worker/config : esm5 as esm5
Debug:   Successfully compiled @angular/service-worker/config : esm5
Debug: No assignments for 2 idle (out of 9 total) workers. Busy workers: 1, 2, 4, 5, 6, 8, 9
Debug:   Successfully compiled @angular/animations : esm2015
Debug: No assignments for 3 idle (out of 9 total) workers. Busy workers: 1, 2, 4, 5, 6, 9
Debug:   Successfully compiled @angular/animations : main
Debug: No assignments for 4 idle (out of 9 total) workers. Busy workers: 1, 2, 4, 5, 6
Debug:   Successfully compiled @angular/compiler/testing : main
Debug: No assignments for 5 idle (out of 9 total) workers. Busy workers: 1, 2, 4, 5
Compiling @angular/core : fesm2015 as esm2015
Compiling @angular/compiler/testing : esm2015 as esm2015
Debug:   Successfully compiled @angular/compiler/testing : esm2015
Debug: No assignments for 6 idle (out of 9 total) workers. Busy workers: 1, 4, 5
Compiling @angular/service-worker/config : main as umd
Compiling @angular/compiler/testing : esm5 as esm5
Debug:   Successfully compiled @angular/compiler/testing : esm5
Debug: No assignments for 7 idle (out of 9 total) workers. Busy workers: 1, 4
Debug:   Successfully compiled @angular/service-worker/config : main
Debug: No assignments for 8 idle (out of 9 total) workers. Busy workers: 1
Debug:   Successfully compiled @angular/core : fesm2015
Debug: [Worker #1] Processing task: {entryPoint: @angular/common, formatProperty: fesm2015, processDts: true}
Debug: [Worker #2] Processing task: {entryPoint: @angular/cdk/collections, formatProperty: fesm2015, processDts: true}
Debug: [Worker #4] Processing task: {entryPoint: @angular/animations/browser, formatProperty: fesm2015, processDts: true}
Debug: [Worker #6] Processing task: {entryPoint: @angular/core/testing, formatProperty: fesm2015, processDts: true}
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #5] Processing task: {entryPoint: @angular/cdk/observers, formatProperty: fesm2015, processDts: true}
Debug: [Worker #3] Processing task: {entryPoint: @ngrx/store, formatProperty: fesm2015, processDts: true}
Debug: [Worker #7] Processing task: {entryPoint: ngx-window-token, formatProperty: fesm2015, processDts: true}
Debug: [Worker #8] Processing task: {entryPoint: @angular/core, formatProperty: fesm5, processDts: false}
Debug: [Worker #9] Processing task: {entryPoint: @angular/core, formatProperty: esm2015, processDts: false}
Compiling @angular/cdk/collections : fesm2015 as esm2015
Compiling @angular/common : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/collections : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #2] Processing task: {entryPoint: @angular/cdk/accordion, formatProperty: fesm2015, processDts: true}
Compiling @angular/animations/browser : fesm2015 as esm2015
Compiling ngx-window-token : fesm2015 as esm2015
Debug:   Successfully compiled ngx-window-token : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #7] Processing task: {entryPoint: @angular/core, formatProperty: esm5, processDts: false}
Debug:   Successfully compiled @angular/common : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #1] Processing task: {entryPoint: @angular/cdk/platform, formatProperty: fesm2015, processDts: true}
Compiling @ngrx/store : fesm2015 as esm2015
Compiling @angular/cdk/observers : fesm2015 as esm2015
Debug:   Successfully compiled @angular/animations/browser : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #4] Processing task: {entryPoint: @angular/cdk/bidi, formatProperty: fesm2015, processDts: true}
Compiling @angular/core/testing : fesm2015 as esm2015
Compiling @angular/core : fesm5 as esm5
Debug:   Successfully compiled @angular/cdk/observers : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #5] Processing task: {entryPoint: @angular/platform-browser, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @ngrx/store : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #3] Processing task: {entryPoint: @angular/common/http, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @angular/core/testing : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #6] Processing task: {entryPoint: @angular/forms, formatProperty: fesm2015, processDts: true}
Compiling @angular/cdk/accordion : fesm2015 as esm2015
Compiling @angular/cdk/platform : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/platform : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #1] Processing task: {entryPoint: @angular/cdk/a11y, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @angular/cdk/accordion : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #2] Processing task: {entryPoint: @angular/cdk/portal, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @angular/core : fesm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #8] Processing task: {entryPoint: @angular/common/testing, formatProperty: fesm2015, processDts: true}
Compiling @angular/core : esm2015 as esm2015
Compiling @angular/cdk/bidi : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/bidi : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #4] Processing task: {entryPoint: @angular/cdk/scrolling, formatProperty: fesm2015, processDts: true}
Compiling @angular/platform-browser : fesm2015 as esm2015
Debug:   Successfully compiled @angular/core : esm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #9] Processing task: {entryPoint: @angular/router, formatProperty: fesm2015, processDts: true}
Compiling @angular/common/http : fesm2015 as esm2015
Compiling @angular/forms : fesm2015 as esm2015
Debug:   Successfully compiled @angular/common/http : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #3] Processing task: {entryPoint: @ngrx/effects, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @angular/platform-browser : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #5] Processing task: {entryPoint: @angular/platform-browser-dynamic, formatProperty: fesm2015, processDts: true}
Compiling @angular/cdk/portal : fesm2015 as esm2015
Debug:   Successfully compiled @angular/forms : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #6] Processing task: {entryPoint: @angular/platform-browser/testing, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @angular/cdk/portal : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #2] Processing task: {entryPoint: @angular/platform-browser/animations, formatProperty: fesm2015, processDts: true}
Compiling @angular/core : esm5 as esm5
Compiling @angular/cdk/a11y : fesm2015 as esm2015
Debug:   Successfully compiled @angular/core : esm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #7] Processing task: {entryPoint: @angular/animations/browser/testing, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @angular/cdk/a11y : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #1] Processing task: {entryPoint: @angular/cdk/clipboard, formatProperty: fesm2015, processDts: true}
Compiling @angular/common/testing : fesm2015 as esm2015
Debug:   Successfully compiled @angular/common/testing : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #8] Processing task: {entryPoint: @angular/cdk/layout, formatProperty: fesm2015, processDts: true}
Compiling @angular/cdk/scrolling : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/scrolling : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #4] Processing task: {entryPoint: @angular/cdk/drag-drop, formatProperty: fesm2015, processDts: true}
Compiling @ngrx/effects : fesm2015 as esm2015
Debug:   Successfully compiled @ngrx/effects : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #3] Processing task: {entryPoint: @angular/cdk/overlay, formatProperty: fesm2015, processDts: true}
Warning: Worker #1 exited unexpectedly (code: null | signal: SIGKILL).
  Current assignment: {entryPoint: @angular/cdk/clipboard, formatProperty: fesm2015, processDts: true}
Debug: Stopping 8 workers...
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: PIDs match (192), so removing /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Error: Process unexpectedly crashed, while processing format property fesm2015 for entry-point '/home/circleci/app/node_modules/@angular/cdk/clipboard'.
    at ClusterMaster.onWorkerExit (/home/circleci/app/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:153:23)
    at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:51:101
    at ClusterMaster.<anonymous> (/home/circleci/app/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:246:57)
    at step (/home/circleci/app/node_modules/tslib/tslib.js:136:27)
    at Object.next (/home/circleci/app/node_modules/tslib/tslib.js:117:57)
    at /home/circleci/app/node_modules/tslib/tslib.js:110:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/home/circleci/app/node_modules/tslib/tslib.js:106:16)
    at EventEmitter.<anonymous> (/home/circleci/app/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:240:32)
    at EventEmitter.emit (events.js:200:13)
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Compiling @angular/platform-browser-dynamic : fesm2015 as esm2015
Debug:   Successfully compiled @angular/platform-browser-dynamic : fesm2015
Compiling @angular/platform-browser/testing : fesm2015 as esm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Debug:   Successfully compiled @angular/platform-browser/testing : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Compiling @angular/router : fesm2015 as esm2015
Compiling @angular/platform-browser/animations : fesm2015 as esm2015
Debug:   Successfully compiled @angular/platform-browser/animations : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Debug:   Successfully compiled @angular/router : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Compiling @angular/animations/browser/testing : fesm2015 as esm2015
Debug:   Successfully compiled @angular/animations/browser/testing : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Compiling @angular/cdk/layout : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/layout : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Compiling @angular/cdk/drag-drop : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/drag-drop : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Compiling @angular/cdk/overlay : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/overlay : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test-ivy-app@0.0.0 ngcc: `ngcc --loglevel debug`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the test-ivy-app@0.0.0 ngcc 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/2020-03-27T15_41_27_725Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test-ivy-app@0.0.0 postinstall: `npm run ngcc`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the test-ivy-app@0.0.0 postinstall 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/2020-03-27T15_41_27_795Z-debug.log

๐ŸŒ Your Environment

Angular Version:


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / โ–ณ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 9.1.0
Node: 12.3.1
OS: linux x64

Angular: 9.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.901.0
@angular-devkit/build-angular     0.901.0
@angular-devkit/build-optimizer   0.901.0
@angular-devkit/build-webpack     0.901.0
@angular-devkit/core              9.1.0
@angular-devkit/schematics        9.1.0
@angular/cdk                      9.2.0
@ngtools/webpack                  9.1.0
@schematics/angular               9.1.0
@schematics/update                0.901.0
rxjs                              6.5.3
typescript                        3.8.3
webpack                           4.42.0

Anything else relevant?

  1. If I ssh into the circle-ci container and run ngcc manually it completes successfully
  2. If I run ngcc locally it works
  3. When ngcc is kicked off from a post install step it fails, or even in circle ci with a stand-alone step it also fails

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 20 (6 by maintainers)

Commits related to this issue

Most upvoted comments

@poloagustin - you will need to manually invoke ngcc as a step prior to building your application. The easiest way to do this by adding/upadting the postinstall script in your package.json.

Example: "postinstall": "ngcc --properties es2015 browser module main --async false",

You could also do something like this and use npm run ngcc prior to running ng build "ngcc": "ngcc --properties es2015 browser module main --async false",

The key factor is that you will want to pre-run ngcc so that it does not need to run again when you run ng build

And same here with 9.1.2 version.

9.1.5 then?

@poloagustin - you will need to manually invoke ngcc as a step prior to building your application. The easiest way to do this by adding/upadting the postinstall script in your package.json.

Example: "postinstall": "ngcc --properties es2015 browser module main --async false",

You could also do something like this and use npm run ngcc prior to running ng build "ngcc": "ngcc --properties es2015 browser module main --async false",

The key factor is that you will want to pre-run ngcc so that it does not need to run again when you run ng build

I would add something to this. If youโ€™re using CircleCI or any other CI utility that allows caching dependencies, you might want to skip the ngcc compile if the binaries are already available from the cache. To do so, change the postinstall script to this :

"postinstall": "ngcc --properties es2015 browser module main --async false --first-only",

This way, if binaries were restored from the cache, youโ€™ll save some precious time here. In our case on CircleCI that saved us around 5 minsโ€ฆ

We have seen this on our own CI builds and @gkalpak is currently investigating. We believe it might be that ngcc is creating a lot of workers to do the parallel processing, and Docker is complaining that it is using too much memory and arbitrarily killing processes. This might be due to ngcc reading that the current machine has more CPUs than the Docker instance is actually allocating.

I see that this was closed some hours ago, but after taking 9.1.4 we still get the error on our CircleCI build pipeline (unless we use the ngcc async=false workaround).

Maybe the fix is not part of 9.1.4?

FYI this is still happening for me in 9.1.1.

Unfortunately you cannot tell CLI to run ngcc sync. But as a workaround you could run ngcc as a prebuild step on your CI directly from the command line where it can have the --no-async/--async=false option. This will process everything first and so the async call to ngcc from CLI will have no work to do and should not cause a crash.