angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.74k stars 11.98k forks source link

Updating to Angular 12 causes memory overflow #22029

Closed vella-nicholas closed 2 years ago

vella-nicholas commented 2 years ago

🐞 Bug report

After updating to Angular 12, CI build does not work anymore on Cloud Provider (both GCP or GH Actions)

Command (mark with an x)

Is this a regression?

Yes, the previous version in which this bug was not present was: CI Build worked fine with Angular 11.

Description

After updating to Angular12, the CI build pipeline is causing memory overflow errors.

πŸ”¬ Minimal Reproduction

npm run staging, which translates to ng build --staging

πŸ”₯ Exception or Error

2021-10-18T07:10:46.8187380Z > fsevents@1.2.13 install /home/runner/work/bluewindow-vulcan/bluewindow-vulcan/node_modules/webpack-dev-server/node_modules/fsevents
2021-10-18T07:10:46.8188506Z > node install.js
2021-10-18T07:10:46.8188870Z 
2021-10-18T07:10:46.8708934Z 
2021-10-18T07:10:46.8713341Z Skipping 'fsevents' build as platform linux is not supported
2021-10-18T07:10:47.2102207Z 
2021-10-18T07:10:47.2105153Z > core-js@3.15.1 postinstall /home/runner/work/bluewindow-vulcan/bluewindow-vulcan/node_modules/@angular-devkit/build-angular/node_modules/core-js
2021-10-18T07:10:47.2107645Z > node -e "try***require('./postinstall')***catch(e)***"
2021-10-18T07:10:47.2108385Z 
2021-10-18T07:10:47.4697004Z 
2021-10-18T07:10:47.4700228Z > preact@8.5.3 postinstall /home/runner/work/bluewindow-vulcan/bluewindow-vulcan/node_modules/preact
2021-10-18T07:10:47.4702163Z > node -e "console.log('\u001b[35m\u001b[1mLove Preact? You can now donate to our open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://opencollective.com/preact/donate\u001b[0m')"
2021-10-18T07:10:47.4703153Z 
2021-10-18T07:10:47.5182944Z Love Preact? You can now donate to our open collective:
2021-10-18T07:10:47.5184777Z  > https://opencollective.com/preact/donate
2021-10-18T07:10:47.5553069Z 
2021-10-18T07:10:47.5555817Z > core-js@3.6.5 postinstall /home/runner/work/bluewindow-vulcan/bluewindow-vulcan/node_modules/@firebase/polyfill/node_modules/core-js
2021-10-18T07:10:47.5558290Z > node -e "try***require('./postinstall')***catch(e)***"
2021-10-18T07:10:47.5559054Z 
2021-10-18T07:10:47.6330627Z 
2021-10-18T07:10:47.6333175Z > protobufjs@6.11.2 postinstall /home/runner/work/bluewindow-vulcan/bluewindow-vulcan/node_modules/protobufjs
2021-10-18T07:10:47.6334481Z > node scripts/postinstall
2021-10-18T07:10:47.6335063Z 
2021-10-18T07:10:47.7167499Z 
2021-10-18T07:10:47.7169629Z > core-js@3.18.3 postinstall /home/runner/work/bluewindow-vulcan/bluewindow-vulcan/node_modules/core-js
2021-10-18T07:10:47.7171807Z > node -e "try***require('./postinstall')***catch(e)***"
2021-10-18T07:10:47.7172296Z 
2021-10-18T07:10:47.9077735Z 
2021-10-18T07:10:47.9079773Z > husky@4.3.8 install /home/runner/work/bluewindow-vulcan/bluewindow-vulcan/node_modules/husky
2021-10-18T07:10:47.9080657Z > node husky install
2021-10-18T07:10:47.9081012Z 
2021-10-18T07:10:47.9804652Z husky > Setting up git hooks
2021-10-18T07:10:48.0072228Z CI detected, skipping Git hooks installation.
2021-10-18T07:10:48.0073105Z husky > Done
2021-10-18T07:10:48.0129464Z 
2021-10-18T07:10:48.0131346Z > husky@4.3.8 postinstall /home/runner/work/bluewindow-vulcan/bluewindow-vulcan/node_modules/husky
2021-10-18T07:10:48.0132600Z > opencollective-postinstall || exit 0
2021-10-18T07:10:48.0133145Z 
2021-10-18T07:10:48.2017094Z 
2021-10-18T07:10:48.2077625Z > core-js@2.6.12 postinstall /home/runner/work/bluewindow-vulcan/bluewindow-vulcan/node_modules/babel-runtime/node_modules/core-js
2021-10-18T07:10:48.2080336Z > node -e "try***require('./postinstall')***catch(e)***"
2021-10-18T07:10:48.2080963Z 
2021-10-18T07:10:48.3504177Z 
2021-10-18T07:10:48.3506873Z > @compodoc/compodoc@1.1.15 postinstall /home/runner/work/bluewindow-vulcan/bluewindow-vulcan/node_modules/@compodoc/compodoc
2021-10-18T07:10:48.3508509Z > opencollective-postinstall || exit 0
2021-10-18T07:10:48.3509259Z 
2021-10-18T07:10:48.5126190Z 
2021-10-18T07:10:48.5128282Z > @angular/cli@12.2.10 postinstall /home/runner/work/bluewindow-vulcan/bluewindow-vulcan/node_modules/@angular/cli
2021-10-18T07:10:48.5129595Z > node ./bin/postinstall/script.js
2021-10-18T07:10:48.5130025Z 
2021-10-18T07:10:48.9398663Z added 2317 packages in 37.509s
2021-10-18T07:10:49.1498730Z 
2021-10-18T07:10:49.1501886Z > nextwork@1.5.1 staging /home/runner/work/bluewindow-vulcan/bluewindow-vulcan
2021-10-18T07:10:49.1508121Z > ng build --configuration=staging
2021-10-18T07:10:49.1508929Z 
2021-10-18T07:10:51.7386048Z - Generating browser application bundles (phase: setup)...
2021-10-18T07:10:55.8284324Z Compiling @angular/core : es2015 as esm2015
2021-10-18T07:10:59.1353033Z Compiling @angular/common : es2015 as esm2015
2021-10-18T07:10:59.7331325Z Compiling @angular/platform-browser : es2015 as esm2015
2021-10-18T07:11:00.0239944Z Compiling @angular/animations : es2015 as esm2015
2021-10-18T07:11:00.0714286Z Compiling @angular/animations/browser : es2015 as esm2015
2021-10-18T07:11:00.3805066Z Compiling @angular/platform-browser/animations : es2015 as esm2015
2021-10-18T07:11:00.5439479Z Compiling @angular/cdk/portal : es2015 as esm2015
2021-10-18T07:11:00.6639754Z Compiling @swimlane/ngx-charts : es2015 as esm2015
2021-10-18T07:11:02.5441834Z Compiling @swimlane/ngx-graph : es2015 as esm2015
2021-10-18T07:11:03.1353727Z Compiling @angular/flex-layout/core : es2015 as esm2015
2021-10-18T07:11:03.4718363Z Compiling @angular/flex-layout/extended : es2015 as esm2015
2021-10-18T07:11:03.7171127Z Compiling @angular/cdk/bidi : es2015 as esm2015
2021-10-18T07:11:03.8126924Z Compiling @angular/flex-layout/flex : es2015 as esm2015
2021-10-18T07:11:04.1150676Z Compiling @angular/flex-layout/grid : es2015 as esm2015
2021-10-18T07:11:04.3487516Z Compiling @angular/flex-layout : es2015 as esm2015
2021-10-18T07:11:04.5340075Z Compiling ng-keyboard-shortcuts : es2015 as esm2015
2021-10-18T07:11:04.9829273Z Compiling @angular/forms : es2015 as esm2015
2021-10-18T07:11:05.8137921Z Compiling ngx-monaco-editor : es2015 as esm2015
2021-10-18T07:11:06.0279907Z Compiling primeng/utils : es2015 as esm2015
2021-10-18T07:11:06.0468251Z Compiling @angular/router : es2015 as esm2015
2021-10-18T07:11:06.4495362Z Compiling primeng/api : es2015 as esm2015
2021-10-18T07:11:06.6060913Z Compiling @angular/cdk/platform : es2015 as esm2015
2021-10-18T07:11:06.7062940Z Compiling @angular/cdk/collections : es2015 as esm2015
2021-10-18T07:11:06.8057747Z Compiling @angular/cdk/scrolling : es2015 as esm2015
2021-10-18T07:11:07.0284009Z Compiling primeng/dom : es2015 as esm2015
2021-10-18T07:11:07.0551490Z Compiling primeng/tooltip : es2015 as esm2015
2021-10-18T07:11:07.1483897Z Compiling primeng/ripple : es2015 as esm2015
2021-10-18T07:11:07.2580530Z Compiling primeng/dropdown : es2015 as esm2015
2021-10-18T07:11:07.4827027Z Compiling primeng/paginator : es2015 as esm2015
2021-10-18T07:11:07.6476537Z Compiling primeng/inputtext : es2015 as esm2015
2021-10-18T07:11:07.7277289Z Compiling primeng/button : es2015 as esm2015
2021-10-18T07:11:07.8479416Z Compiling primeng/selectbutton : es2015 as esm2015
2021-10-18T07:11:07.9673668Z Compiling primeng/tristatecheckbox : es2015 as esm2015
2021-10-18T07:11:08.0560683Z Compiling primeng/calendar : es2015 as esm2015
2021-10-18T07:11:08.2969863Z Compiling primeng/inputnumber : es2015 as esm2015
2021-10-18T07:11:08.4400251Z Compiling primeng/table : es2015 as esm2015
2021-10-18T07:11:08.9075089Z Compiling primeng/multiselect : es2015 as esm2015
2021-10-18T07:11:09.1218886Z Compiling primeng/inputswitch : es2015 as esm2015
2021-10-18T07:11:09.2122455Z Compiling primeng/focustrap : es2015 as esm2015
2021-10-18T07:11:09.2893875Z Compiling primeng/dialog : es2015 as esm2015
2021-10-18T07:11:09.4329929Z Compiling primeng/inputmask : es2015 as esm2015
2021-10-18T07:11:09.5391543Z Compiling primeng/confirmdialog : es2015 as esm2015
2021-10-18T07:11:09.6747923Z Compiling primeng/progressspinner : es2015 as esm2015
2021-10-18T07:11:09.7473020Z Compiling primeng/togglebutton : es2015 as esm2015
2021-10-18T07:11:09.8596128Z Compiling primeng/dynamicdialog : es2015 as esm2015
2021-10-18T07:11:10.0463360Z Compiling primeng/scrollpanel : es2015 as esm2015
2021-10-18T07:11:10.1534043Z Compiling primeng/checkbox : es2015 as esm2015
2021-10-18T07:11:10.2419419Z Compiling primeng/fieldset : es2015 as esm2015
2021-10-18T07:11:10.3639284Z Compiling primeng/tabview : es2015 as esm2015
2021-10-18T07:11:10.4895959Z Compiling primeng/card : es2015 as esm2015
2021-10-18T07:11:10.5974920Z Compiling primeng/message : es2015 as esm2015
2021-10-18T07:11:10.6761237Z Compiling primeng/panel : es2015 as esm2015
2021-10-18T07:11:10.7884971Z Compiling primeng/toast : es2015 as esm2015
2021-10-18T07:11:10.9088001Z Compiling primeng/breadcrumb : es2015 as esm2015
2021-10-18T07:11:11.0358348Z Compiling primeng/chips : es2015 as esm2015
2021-10-18T07:11:11.1452532Z Compiling primeng/autocomplete : es2015 as esm2015
2021-10-18T07:11:11.3505060Z Compiling primeng/listbox : es2015 as esm2015
2021-10-18T07:11:11.5009017Z Compiling primeng/contextmenu : es2015 as esm2015
2021-10-18T07:11:11.6799791Z Compiling primeng/overlaypanel : es2015 as esm2015
2021-10-18T07:11:11.7848719Z Compiling primeng/blockui : es2015 as esm2015
2021-10-18T07:11:11.8809566Z Compiling primeng/radiobutton : es2015 as esm2015
2021-10-18T07:11:11.9770544Z Compiling primeng/accordion : es2015 as esm2015
2021-10-18T07:11:12.0896982Z Compiling primeng/carousel : es2015 as esm2015
2021-10-18T07:11:12.2298889Z Compiling primeng/chart : es2015 as esm2015
2021-10-18T07:11:12.3083522Z Compiling primeng/codehighlighter : es2015 as esm2015
2021-10-18T07:11:12.3900088Z Compiling primeng/colorpicker : es2015 as esm2015
2021-10-18T07:11:12.4966108Z Compiling primeng/dataview : es2015 as esm2015
2021-10-18T07:11:12.6496708Z Compiling primeng/messages : es2015 as esm2015
2021-10-18T07:11:12.7555860Z Compiling primeng/progressbar : es2015 as esm2015
2021-10-18T07:11:12.8348249Z Compiling @angular/common/http : es2015 as esm2015
2021-10-18T07:11:13.0564152Z Compiling primeng/fileupload : es2015 as esm2015
2021-10-18T07:11:13.2294359Z Compiling primeng/fullcalendar : es2015 as esm2015
2021-10-18T07:11:13.3711988Z Compiling primeng/galleria : es2015 as esm2015
2021-10-18T07:11:13.5441849Z Compiling primeng/inplace : es2015 as esm2015
2021-10-18T07:11:13.6518567Z Compiling primeng/inputtextarea : es2015 as esm2015
2021-10-18T07:11:13.7407221Z Compiling primeng/lightbox : es2015 as esm2015
2021-10-18T07:11:13.8409945Z Compiling primeng/megamenu : es2015 as esm2015
2021-10-18T07:11:14.0643473Z Compiling primeng/menubar : es2015 as esm2015
2021-10-18T07:11:14.4193041Z Compiling @angular/cdk/keycodes : es2015 as esm2015
2021-10-18T07:11:14.5364275Z Compiling @angular/cdk/observers : es2015 as esm2015
2021-10-18T07:11:14.7596399Z Compiling @angular/cdk/a11y : es2015 as esm2015
2021-10-18T07:11:15.0788643Z Compiling @angular/cdk/drag-drop : es2015 as esm2015
2021-10-18T07:11:15.4209708Z Compiling primeng/orderlist : es2015 as esm2015
2021-10-18T07:11:15.6019381Z Compiling primeng/organizationchart : es2015 as esm2015
2021-10-18T07:11:15.7260393Z Compiling primeng/panelmenu : es2015 as esm2015
2021-10-18T07:11:15.8489067Z Compiling primeng/password : es2015 as esm2015
2021-10-18T07:11:15.9709416Z Compiling primeng/picklist : es2015 as esm2015
2021-10-18T07:11:16.2199516Z Compiling primeng/rating : es2015 as esm2015
2021-10-18T07:11:16.3486395Z Compiling primeng/sidebar : es2015 as esm2015
2021-10-18T07:11:16.4556361Z Compiling primeng/slidemenu : es2015 as esm2015
2021-10-18T07:11:16.5739452Z Compiling primeng/slider : es2015 as esm2015
2021-10-18T07:11:16.6813701Z Compiling primeng/menu : es2015 as esm2015
2021-10-18T07:11:16.8057769Z Compiling primeng/splitbutton : es2015 as esm2015
2021-10-18T07:11:16.9068333Z Compiling primeng/steps : es2015 as esm2015
2021-10-18T07:11:17.0138135Z Compiling primeng/tabmenu : es2015 as esm2015
2021-10-18T07:11:17.1211579Z Compiling primeng/terminal : es2015 as esm2015
2021-10-18T07:11:17.2118578Z Compiling primeng/tieredmenu : es2015 as esm2015
2021-10-18T07:11:17.3440791Z Compiling primeng/toolbar : es2015 as esm2015
2021-10-18T07:11:17.4318713Z Compiling primeng/tree : es2015 as esm2015
2021-10-18T07:11:17.6327928Z Compiling primeng/treetable : es2015 as esm2015
2021-10-18T07:11:17.9180020Z Compiling primeng/virtualscroller : es2015 as esm2015
2021-10-18T07:11:18.0442514Z Compiling primeng/divider : es2015 as esm2015
2021-10-18T07:11:18.1240517Z Compiling primeng/confirmpopup : es2015 as esm2015
2021-10-18T07:11:18.2290092Z Compiling primeng/dragdrop : es2015 as esm2015
2021-10-18T07:11:18.3157801Z Compiling primeng/tag : es2015 as esm2015
2021-10-18T07:11:18.3877937Z Compiling @ngx-pwa/local-storage : es2015 as esm2015
2021-10-18T07:11:18.5722743Z Compiling ngx-window-token : es2015 as esm2015
2021-10-18T07:11:18.6390147Z Compiling ngx-clipboard : es2015 as esm2015
2021-10-18T07:11:18.7471275Z Compiling ngx-trim-directive : es2015 as esm2015
2021-10-18T07:11:18.8277334Z Compiling ngx-csv-parser : es2015 as esm2015
2021-10-18T07:11:18.9167504Z Compiling ngx-store : es2015 as esm2015
2021-10-18T07:11:19.1211895Z Compiling ngx-editor/utils : es2015 as esm2015
2021-10-18T07:11:19.1291909Z Compiling ngx-editor/schema : es2015 as esm2015
2021-10-18T07:11:19.1950421Z Compiling ngx-editor/helpers : es2015 as esm2015
2021-10-18T07:11:19.2351773Z Compiling ngx-editor/commands : es2015 as esm2015
2021-10-18T07:11:19.2879343Z Compiling ngx-editor : es2015 as esm2015
2021-10-18T07:11:19.6444868Z Compiling @kolkov/angular-editor : es2015 as esm2015
2021-10-18T07:11:19.9115416Z Compiling @angular/core/testing : es2015 as esm2015
2021-10-18T07:11:20.2486524Z Compiling @angular/platform-browser-dynamic : es2015 as esm2015
2021-10-18T07:11:20.4467284Z Compiling @angular/platform-browser/testing : es2015 as esm2015
2021-10-18T07:11:20.5348245Z Compiling @angular/compiler/testing : es2015 as esm2015
2021-10-18T07:11:20.6582607Z Compiling @angular/platform-browser-dynamic/testing : es2015 as esm2015
2021-10-18T07:13:09.8937190Z 
2021-10-18T07:13:09.8973541Z <--- Last few GCs --->
2021-10-18T07:13:09.8973960Z 
2021-10-18T07:13:09.8975034Z [1741:0x5bda7d0]   137140 ms: Scavenge (reduce) 2031.1 (2051.0) -> 2030.2 (2052.0) MB, 12.1 / 0.0 ms  (average mu = 0.298, current mu = 0.270) allocation failure 
2021-10-18T07:13:09.8976956Z [1741:0x5bda7d0]   138748 ms: Mark-sweep (reduce) 2031.7 (2051.5) -> 2020.7 (2052.5) MB, 1603.8 / 0.1 ms  (+ 0.0 ms in 19 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 1621 ms) (average mu = 0.268, current mu = 0.235) 
2021-10-18T07:13:09.8977829Z 
2021-10-18T07:13:09.8978439Z <--- JS stacktrace --->
2021-10-18T07:13:09.8978814Z 
2021-10-18T07:13:09.8979851Z FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
2021-10-18T07:13:09.8982200Z  1: 0xa389b0 node::Abort() [ng build --configuration=staging]
2021-10-18T07:13:09.8983580Z  2: 0x96e0af node::FatalError(char const*, char const*) [ng build --configuration=staging]
2021-10-18T07:13:09.8985089Z  3: 0xbb7a4e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [ng build --configuration=staging]
2021-10-18T07:13:09.8986869Z  4: 0xbb7dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [ng build --configuration=staging]
2021-10-18T07:13:09.8988161Z  5: 0xd73fd5  [ng build --configuration=staging]
2021-10-18T07:13:09.8989038Z  6: 0xd74b5f  [ng build --configuration=staging]
2021-10-18T07:13:09.8990821Z  7: 0xd8299b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [ng build --configuration=staging]
2021-10-18T07:13:09.8993506Z  8: 0xd8655c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [ng build --configuration=staging]
2021-10-18T07:13:09.8995998Z  9: 0xd54c3b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [ng build --configuration=staging]
2021-10-18T07:13:09.8998020Z 10: 0x109d21f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [ng build --configuration=staging]
2021-10-18T07:13:09.8999647Z 11: 0x1446379  [ng build --configuration=staging]
2021-10-18T07:13:10.1977847Z Aborted (core dumped)
2021-10-18T07:13:10.2002028Z npm ERR! code ELIFECYCLE
2021-10-18T07:13:10.2003663Z npm ERR! errno 134
2021-10-18T07:13:10.2035536Z npm ERR! nextwork@1.5.1 staging: `ng build --configuration=staging`
2021-10-18T07:13:10.2036301Z npm ERR! Exit status 134
2021-10-18T07:13:10.2036804Z npm ERR! 
2021-10-18T07:13:10.2037430Z npm ERR! Failed at the nextwork@1.5.1 staging script.
2021-10-18T07:13:10.2038392Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-10-18T07:13:10.2076556Z 
2021-10-18T07:13:10.2077451Z npm ERR! A complete log of this run can be found in:
2021-10-18T07:13:10.2078780Z npm ERR!     /home/runner/.npm/_logs/2021-10-18T07_13_10_203Z-debug.log
2021-10-18T07:13:10.2156707Z ##[error]Process completed with exit code 134.
2021-10-18T07:13:10.2268680Z Post job cleanup.
2021-10-18T07:13:10.3227576Z [command]/usr/bin/git version
2021-10-18T07:13:10.3271654Z git version 2.33.0
2021-10-18T07:13:10.3314615Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2021-10-18T07:13:10.3350418Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2021-10-18T07:13:10.3588433Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2021-10-18T07:13:10.3619850Z http.https://github.com/.extraheader
2021-10-18T07:13:10.3629423Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2021-10-18T07:13:10.3698458Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2021-10-18T07:13:10.4018279Z Cleaning up orphan processes

🌍 Your Environment


Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1202.10
@angular-devkit/build-angular   12.1.1
@angular-devkit/core            12.2.10
@angular-devkit/schematics      12.2.10
@angular/cdk                    12.2.9
@angular/fire                   7.1.0
@angular/flex-layout            10.0.0-beta.32
@schematics/angular             12.2.10
rxjs                            6.6.7
typescript                      4.2.3
webpack                         5.58.2

**Anything else relevant?**
This happens on GCP and GH Actions. Locally the build works fine, even deployment. I need help in profiling the build to identify which packages are slowing things down.            
alan-agius4 commented 2 years ago

Looks like NGCC is crashing. Transferring to the FW repo for a better triage.

vella-nicholas commented 2 years ago

Looks like NGCC is crashing. Transferring to the FW repo for a better triage.

Thanks @alan-agius4 ... Are there any commands I can run to pull more metrics please, maybe I can identify the package which is givning me issues?

alan-agius4 commented 2 years ago

Hi @vella-nicholas,

@petebacondarwin noticed that between the last NGCC message and the crash almost two hours has elapsed.

2021-10-18T07:11:20.6582607Z Compiling @angular/platform-browser-dynamic/testing : es2015 as esm2015
2021-10-18T07:13:09.8937190Z 
2021-10-18T07:13:09.8973541Z <--- Last few GCs --->

I think for starters what you can do it to try to run the build with verbose logging using the --verbose flag.

What is also interesting is that NGCC is picking up @angular/platform-browser-dynamic/testing as being a dependency of your application. This shouldn't be the case as this entry-point should only be used for testing purposes and setups.

vella-nicholas commented 2 years ago

Hi @vella-nicholas,

@petebacondarwin noticed that between the last NGCC message and the crash almost two hours has elapsed.

2021-10-18T07:11:20.6582607Z Compiling @angular/platform-browser-dynamic/testing : es2015 as esm2015
2021-10-18T07:13:09.8937190Z 
2021-10-18T07:13:09.8973541Z <--- Last few GCs --->

I think for starters what you can do it to try to run the build with verbose logging using the --verbose flag.

What is also interesting is that NGCC is picking up @angular/platform-browser-dynamic/testing as being a dependency of your application. This shouldn't be the case as this entry-point should only be used for testing purposes and setups.

It is 2 minutes, not 2 hours, the time is 07:11:20.6582607 and the crash is 07:13:09.8973541Z.

As for @angular/platform-browser-dynamic/testing, this one baffles me too, it is only used in a test.ts file required by karma config. The funny thing is this, if I remove any reference to platform-browser-dynamic/testing the build gets stuck in @angular/compiler/testing, if I remove that reference it gets stuck on @angular/platform-browser/testing (so on and so forth). I will retry the build with --verbose on and post it in a different comment.

alan-agius4 commented 2 years ago

As for @angular/platform-browser-dynamic/testing, this one baffles me too, it is only used in a test.ts file required by karma config. The funny thing is this, if I remove any reference to platform-browser-dynamic/testing the build gets stuck in @angular/compiler/testing, if I remove that reference it gets stuck on @angular/platform-browser/testing (so on and so forth). I will retry the build with --verbose on and post it in a different comment.

Ummm so maybe it's something other than NGCC, which is crashing the build. Those logs would be great thanks :)

vella-nicholas commented 2 years ago

I think at this point is to try and provide as much as info as possible. I will start off by angular.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "nextwork": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        }
      },
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "allowedCommonJsDependencies": [
              "hammerjs",
              "webcola",
              "firebase/app",
              "@firebase/app",
              "@firebase/firestore",
              "@firebase/component",
              "@firebase/util",
              "dagre",
              "rxjs",
              "rxjs-compat",
              "@fullcalendar/daygrid",
              "@fullcalendar/timegrid",
              "@fullcalendar/interaction",
              "chart.js"
            ],
            "outputPath": "public",
            "index": "src/index.html",
            "main": "src/main.ts",
            "tsConfig": "src/tsconfig.app.json",
            "polyfills": "src/polyfills.ts",
            "assets": [
              "src/assets",
              "src/favicon.ico",
              {
                "glob": "**/*",
                "input": "node_modules/ngx-auth-firebaseui/assets/",
                "output": "./assets/"
              },
              {
                "glob": "**/*",
                "input": "node_modules/ngx-monaco-editor/assets/monaco",
                "output": "./assets/monaco/"
              }
            ],
            "styles": [
              "node_modules/flag-icon-css/css/flag-icon.min.css",
              "node_modules/instantsearch.css/themes/algolia.css",
              "src/styles.scss"
            ],
            "scripts": [
              "node_modules/prismjs/prism.js",
              "node_modules/prismjs/components/prism-typescript.js"
            ],
            "aot": false,
            "vendorChunk": true,
            "extractLicenses": false,
            "buildOptimizer": false,
            "sourceMap": true,
            "optimization": false,
            "namedChunks": true
          },
          "configurations": {
            "production": {
              "optimization": true,
              "outputHashing": "all",
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]
            },
            "staging": {
              "optimization": true,
              "outputHashing": "all",
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "verbose": true,
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.staging.ts"
                }
              ]
            }
          },
          "defaultConfiguration": ""
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "nextwork:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "nextwork:build:production"
            },
            "staging": {
              "browserTarget": "nextwork:build:staging"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "nextwork:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "karmaConfig": "src/karma.conf.js",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.spec.json",
            "scripts": [],
            "styles": [
              "src/styles.scss"
            ],
            "assets": [
              "src/assets",
              "src/favicon.ico"
            ]
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "src/tsconfig.app.json",
              "src/tsconfig.spec.json"
            ],
            "exclude": []
          }
        }
      }
    },
    "nextwork-e2e": {
      "root": "e2e/",
      "projectType": "application",
      "architect": {
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "nextwork:serve"
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": "e2e/tsconfig.e2e.json",
            "exclude": [
              "**/node_modules/**"
            ]
          }
        }
      }
    }
  },
  "defaultProject": "nextwork",
  "cli": {
    "analytics": false
  }
}
vella-nicholas commented 2 years ago

tsconfig:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "module": "esnext",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowJs": true,
    "forceConsistentCasingInFileNames": false,
    "target": "es2015",
    "skipLibCheck": true,
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2019",
      "dom"
    ],
        "paths": {
            "@shared/*": [
                "src/app/shared/*"
            ],
            "@shared": [
                "src/app/shared"
      ]
    }
  },
  "angularCompilerOptions": {
    "enableIvy": true
  },
  "allowSyntheticDefaultImports": true,
  "esModuleInterop": true
}
vella-nicholas commented 2 years ago

GCP Build with verbose on (something seems off as the logs do not seem too verbose in my opinion):

starting build "2ccef26e-2464-4d07-82a2-e14a715eff22"

FETCHSOURCE
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint:   git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint:   git branch -m <name>
Initialized empty Git repository in /workspace/.git/
From https://github.com/bw-gaming/bluewindow-vulcan
 * branch            d4fedb5d5fd33ad84776e27c8f98ca752c5e30a4 -> FETCH_HEAD
HEAD is now at d4fedb5 Verbose = true (for real this time)
BUILD
Starting Step #0
Step #0: Pulling image: node:16.9.1-alpine3.11
Step #0: 16.9.1-alpine3.11: Pulling from library/node
Step #0: 6a428f9f83b0: Pulling fs layer
Step #0: c46c3665f3e1: Pulling fs layer
Step #0: f284663d3eaa: Pulling fs layer
Step #0: aceca668727d: Pulling fs layer
Step #0: aceca668727d: Waiting
Step #0: f284663d3eaa: Verifying Checksum
Step #0: f284663d3eaa: Download complete
Step #0: 6a428f9f83b0: Verifying Checksum
Step #0: 6a428f9f83b0: Download complete
Step #0: aceca668727d: Verifying Checksum
Step #0: aceca668727d: Download complete
Step #0: 6a428f9f83b0: Pull complete
Step #0: c46c3665f3e1: Verifying Checksum
Step #0: c46c3665f3e1: Download complete
Step #0: c46c3665f3e1: Pull complete
Step #0: f284663d3eaa: Pull complete
Step #0: aceca668727d: Pull complete
Step #0: Digest: sha256:70d7c386b79755bf2179aeb691d926fc04c52b21b1224350c09d928e98d2dd04
Step #0: Status: Downloaded newer image for node:16.9.1-alpine3.11
Step #0: docker.io/library/node:16.9.1-alpine3.11
Step #0: npm WARN old lockfile 
Step #0: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
Step #0: npm WARN old lockfile so supplemental metadata must be fetched from the registry.
Step #0: npm WARN old lockfile 
Step #0: npm WARN old lockfile This is a one-time fix-up, please be patient...
Step #0: npm WARN old lockfile 
Step #0: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
Step #0: npm WARN deprecated uuid@3.3.3: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
Step #0: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
Step #0: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
Step #0: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
Step #0: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
Step #0: npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
Step #0: npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
Step #0: npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
Step #0: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
Step #0: npm WARN deprecated mkdirp@0.3.0: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
Step #0: npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
Step #0: npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
Step #0: 
Step #0: added 2309 packages, and audited 2310 packages in 2m
Step #0: 
Step #0: 158 packages are looking for funding
Step #0:   run `npm fund` for details
Step #0: 
Step #0: 31 vulnerabilities (8 moderate, 23 high)
Step #0: 
Step #0: To address issues that do not require attention, run:
Step #0:   npm audit fix
Step #0: 
Step #0: Some issues need review, and may require choosing
Step #0: a different dependency.
Step #0: 
Step #0: Run `npm audit` for details.
Finished Step #0
Starting Step angular/angular#1
Step angular/angular#1: Already have image: node:16.9.1-alpine3.11
Step angular/angular#1: 
Step angular/angular#1: > nextwork@1.5.1 staging
Step angular/angular#1: > ng build --configuration=staging
Step angular/angular#1: 
Step angular/angular#1: - Generating browser application bundles (phase: setup)...
Step angular/angular#1: Compiling @angular/core : es2015 as esm2015
Step angular/angular#1: Compiling @angular/common : es2015 as esm2015
Step angular/angular#1: Compiling @angular/platform-browser : es2015 as esm2015
Step angular/angular#1: Compiling @angular/animations : es2015 as esm2015
Step angular/angular#1: Compiling @angular/animations/browser : es2015 as esm2015
Step angular/angular#1: Compiling @angular/platform-browser/animations : es2015 as esm2015
Step angular/angular#1: Compiling @angular/cdk/portal : es2015 as esm2015
Step angular/angular#1: Compiling @swimlane/ngx-charts : es2015 as esm2015
Step angular/angular#1: Compiling @swimlane/ngx-graph : es2015 as esm2015
Step angular/angular#1: Compiling @angular/flex-layout/core : es2015 as esm2015
Step angular/angular#1: Compiling @angular/flex-layout/extended : es2015 as esm2015
Step angular/angular#1: Compiling @angular/cdk/bidi : es2015 as esm2015
Step angular/angular#1: Compiling @angular/flex-layout/flex : es2015 as esm2015
Step angular/angular#1: Compiling @angular/flex-layout/grid : es2015 as esm2015
Step angular/angular#1: Compiling @angular/flex-layout : es2015 as esm2015
Step angular/angular#1: Compiling ng-keyboard-shortcuts : es2015 as esm2015
Step angular/angular#1: Compiling @angular/forms : es2015 as esm2015
Step angular/angular#1: Compiling ngx-monaco-editor : es2015 as esm2015
Step angular/angular#1: Compiling primeng/utils : es2015 as esm2015
Step angular/angular#1: Compiling @angular/router : es2015 as esm2015
Step angular/angular#1: Compiling primeng/api : es2015 as esm2015
Step angular/angular#1: Compiling @angular/cdk/platform : es2015 as esm2015
Step angular/angular#1: Compiling @angular/cdk/collections : es2015 as esm2015
Step angular/angular#1: Compiling @angular/cdk/scrolling : es2015 as esm2015
Step angular/angular#1: Compiling primeng/dom : es2015 as esm2015
Step angular/angular#1: Compiling primeng/tooltip : es2015 as esm2015
Step angular/angular#1: Compiling primeng/ripple : es2015 as esm2015
Step angular/angular#1: Compiling primeng/dropdown : es2015 as esm2015
Step angular/angular#1: Compiling primeng/paginator : es2015 as esm2015
Step angular/angular#1: Compiling primeng/inputtext : es2015 as esm2015
Step angular/angular#1: Compiling primeng/button : es2015 as esm2015
Step angular/angular#1: Compiling primeng/selectbutton : es2015 as esm2015
Step angular/angular#1: Compiling primeng/tristatecheckbox : es2015 as esm2015
Step angular/angular#1: Compiling primeng/calendar : es2015 as esm2015
Step angular/angular#1: Compiling primeng/inputnumber : es2015 as esm2015
Step angular/angular#1: Compiling primeng/table : es2015 as esm2015
Step angular/angular#1: Compiling primeng/multiselect : es2015 as esm2015
Step angular/angular#1: Compiling primeng/inputswitch : es2015 as esm2015
Step angular/angular#1: Compiling primeng/focustrap : es2015 as esm2015
Step angular/angular#1: Compiling primeng/dialog : es2015 as esm2015
Step angular/angular#1: Compiling primeng/inputmask : es2015 as esm2015
Step angular/angular#1: Compiling primeng/confirmdialog : es2015 as esm2015
Step angular/angular#1: Compiling primeng/progressspinner : es2015 as esm2015
Step angular/angular#1: Compiling primeng/togglebutton : es2015 as esm2015
Step angular/angular#1: Compiling primeng/dynamicdialog : es2015 as esm2015
Step angular/angular#1: Compiling primeng/scrollpanel : es2015 as esm2015
Step angular/angular#1: Compiling primeng/checkbox : es2015 as esm2015
Step angular/angular#1: Compiling primeng/fieldset : es2015 as esm2015
Step angular/angular#1: Compiling primeng/tabview : es2015 as esm2015
Step angular/angular#1: Compiling primeng/card : es2015 as esm2015
Step angular/angular#1: Compiling primeng/message : es2015 as esm2015
Step angular/angular#1: Compiling primeng/panel : es2015 as esm2015
Step angular/angular#1: Compiling primeng/toast : es2015 as esm2015
Step angular/angular#1: Compiling primeng/breadcrumb : es2015 as esm2015
Step angular/angular#1: Compiling primeng/chips : es2015 as esm2015
Step angular/angular#1: Compiling primeng/autocomplete : es2015 as esm2015
Step angular/angular#1: Compiling primeng/listbox : es2015 as esm2015
Step angular/angular#1: Compiling primeng/contextmenu : es2015 as esm2015
Step angular/angular#1: Compiling primeng/overlaypanel : es2015 as esm2015
Step angular/angular#1: Compiling primeng/blockui : es2015 as esm2015
Step angular/angular#1: Compiling primeng/radiobutton : es2015 as esm2015
Step angular/angular#1: Compiling primeng/accordion : es2015 as esm2015
Step angular/angular#1: Compiling primeng/carousel : es2015 as esm2015
Step angular/angular#1: Compiling primeng/chart : es2015 as esm2015
Step angular/angular#1: Compiling primeng/codehighlighter : es2015 as esm2015
Step angular/angular#1: Compiling primeng/colorpicker : es2015 as esm2015
Step angular/angular#1: Compiling primeng/dataview : es2015 as esm2015
Step angular/angular#1: Compiling primeng/messages : es2015 as esm2015
Step angular/angular#1: Compiling primeng/progressbar : es2015 as esm2015
Step angular/angular#1: Compiling @angular/common/http : es2015 as esm2015
Step angular/angular#1: Compiling primeng/fileupload : es2015 as esm2015
Step angular/angular#1: Compiling primeng/fullcalendar : es2015 as esm2015
Step angular/angular#1: Compiling primeng/galleria : es2015 as esm2015
Step angular/angular#1: Compiling primeng/inplace : es2015 as esm2015
Step angular/angular#1: Compiling primeng/inputtextarea : es2015 as esm2015
Step angular/angular#1: Compiling primeng/lightbox : es2015 as esm2015
Step angular/angular#1: Compiling primeng/megamenu : es2015 as esm2015
Step angular/angular#1: Compiling primeng/menubar : es2015 as esm2015
Step angular/angular#1: Compiling @angular/cdk/keycodes : es2015 as esm2015
Step angular/angular#1: Compiling @angular/cdk/observers : es2015 as esm2015
Step angular/angular#1: Compiling @angular/cdk/a11y : es2015 as esm2015
Step angular/angular#1: Compiling @angular/cdk/drag-drop : es2015 as esm2015
Step angular/angular#1: Compiling primeng/orderlist : es2015 as esm2015
Step angular/angular#1: Compiling primeng/organizationchart : es2015 as esm2015
Step angular/angular#1: Compiling primeng/panelmenu : es2015 as esm2015
Step angular/angular#1: Compiling primeng/password : es2015 as esm2015
Step angular/angular#1: Compiling primeng/picklist : es2015 as esm2015
Step angular/angular#1: Compiling primeng/rating : es2015 as esm2015
Step angular/angular#1: Compiling primeng/sidebar : es2015 as esm2015
Step angular/angular#1: Compiling primeng/slidemenu : es2015 as esm2015
Step angular/angular#1: Compiling primeng/slider : es2015 as esm2015
Step angular/angular#1: Compiling primeng/menu : es2015 as esm2015
Step angular/angular#1: Compiling primeng/splitbutton : es2015 as esm2015
Step angular/angular#1: Compiling primeng/steps : es2015 as esm2015
Step angular/angular#1: Compiling primeng/tabmenu : es2015 as esm2015
Step angular/angular#1: Compiling primeng/terminal : es2015 as esm2015
Step angular/angular#1: Compiling primeng/tieredmenu : es2015 as esm2015
Step angular/angular#1: Compiling primeng/toolbar : es2015 as esm2015
Step angular/angular#1: Compiling primeng/tree : es2015 as esm2015
Step angular/angular#1: Compiling primeng/treetable : es2015 as esm2015
Step angular/angular#1: Compiling primeng/virtualscroller : es2015 as esm2015
Step angular/angular#1: Compiling primeng/divider : es2015 as esm2015
Step angular/angular#1: Compiling primeng/confirmpopup : es2015 as esm2015
Step angular/angular#1: Compiling primeng/dragdrop : es2015 as esm2015
Step angular/angular#1: Compiling primeng/tag : es2015 as esm2015
Step angular/angular#1: Compiling @ngx-pwa/local-storage : es2015 as esm2015
Step angular/angular#1: Compiling ngx-window-token : es2015 as esm2015
Step angular/angular#1: Compiling ngx-clipboard : es2015 as esm2015
Step angular/angular#1: Compiling ngx-trim-directive : es2015 as esm2015
Step angular/angular#1: Compiling ngx-csv-parser : es2015 as esm2015
Step angular/angular#1: Compiling ngx-store : es2015 as esm2015
Step angular/angular#1: Compiling ngx-editor/utils : es2015 as esm2015
Step angular/angular#1: Compiling ngx-editor/schema : es2015 as esm2015
Step angular/angular#1: Compiling ngx-editor/helpers : es2015 as esm2015
Step angular/angular#1: Compiling ngx-editor/commands : es2015 as esm2015
Step angular/angular#1: Compiling ngx-editor : es2015 as esm2015
Step angular/angular#1: Compiling @kolkov/angular-editor : es2015 as esm2015
Step angular/angular#1: Compiling @angular/core/testing : es2015 as esm2015
Step angular/angular#1: Compiling @angular/platform-browser-dynamic : es2015 as esm2015
Step angular/angular#1: Compiling @angular/platform-browser/testing : es2015 as esm2015
Step angular/angular#1: Compiling @angular/compiler/testing : es2015 as esm2015
Step angular/angular#1: Compiling @angular/platform-browser-dynamic/testing : es2015 as esm2015
Step angular/angular#1: 
Step angular/angular#1: <--- Last few GCs --->
Step angular/angular#1: 
Step angular/angular#1: [20:0x5615adde2040]   437422 ms: Scavenge (reduce) 1945.7 (1996.9) -> 1945.1 (1996.9) MB, 9.6 / 0.0 ms  (average mu = 0.287, current mu = 0.271) allocation failure 
Step angular/angular#1: [20:0x5615adde2040]   437440 ms: Scavenge (reduce) 1946.0 (1996.9) -> 1945.4 (1996.9) MB, 13.1 / 0.0 ms  (average mu = 0.287, current mu = 0.271) allocation failure 
Step angular/angular#1: [20:0x5615adde2040]   437472 ms: Scavenge (reduce) 1946.3 (1996.9) -> 1945.6 (1996.9) MB, 27.5 / 0.0 ms  (average mu = 0.287, current mu = 0.271) allocation failure 
Step angular/angular#1: 
Step angular/angular#1: 
Step angular/angular#1: <--- JS stacktrace --->
Step angular/angular#1: 
Step angular/angular#1: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Step angular/angular#1: npm ERR! path /workspace
Step angular/angular#1: npm ERR! command failed
Step angular/angular#1: npm ERR! signal SIGABRT
Step angular/angular#1: npm ERR! command sh -c ng build --configuration=staging
Step angular/angular#1: 
Step angular/angular#1: npm ERR! A complete log of this run can be found in:
Step angular/angular#1: npm ERR!     /builder/home/.npm/_logs/2021-10-18T14_21_11_216Z-debug.log
Finished Step angular/angular#1
ERROR
ERROR: build step 1 "node:16.9.1-alpine3.11" failed: step exited with non-zero status: 1
alan-agius4 commented 2 years ago

@vella-nicholas, by verbose I meant running the Angular CLI in verbose mode ie:

ng build --configuration=staging --verbose
vella-nicholas commented 2 years ago

@vella-nicholas, by verbose I meant running the Angular CLI in verbose mode ie:

ng build --configuration=staging --verbose

I did that to be honest but did not log anything on GCP, I will try again using GH Actions. In the mean time I shared some config which can help in investigating my issue because I cannot understand why this is happening.

vella-nicholas commented 2 years ago

I ran ng build --configuration=staging --verbose locally. No errors (the issue is only on CI pipeline). I am sharing a link to the log file (too long for comments). Can you confirm you can access the file please: https://filebin.net/yyphqp0qdv6hwuoy

petebacondarwin commented 2 years ago

Looking at that log. It seems like ngcc completed on a previous build, so is not having to run again. It might be worth reinstalling node_modules, and then doing a clean build again with the verbose logging to see where ngcc fits in this.

vella-nicholas commented 2 years ago

Looking at that log. It seems like ngcc completed on a previous build, so is not having to run again. It might be worth reinstalling node_modules, and then doing a clean build again with the verbose logging to see where ngcc fits in this.

@petebacondarwin You can use the same link to download logs_build_v2 (https://filebin.net/yyphqp0qdv6hwuoy). Did a hard delete of npm_modules, npm i -f and ran ng build --configuration=staging --verbose &> logs_build_v2.txt

petebacondarwin commented 2 years ago

Interesting to note that the crash (in your CI) is occurring between these two logs:

Compiling @angular/platform-browser-dynamic/testing : es2015 as esm2015
βœ” Browser application bundle generation complete.

I suspect that ngcc is not the point of failure here. More likely there is some aspect of the ngc build, perhaps, that is using too much memory.

vella-nicholas commented 2 years ago

Interesting to note that the crash (in your CI) is occurring between these two logs:

Compiling @angular/platform-browser-dynamic/testing : es2015 as esm2015
βœ” Browser application bundle generation complete.

I suspect that ngcc is not the point of failure here. More likely there is some aspect of the ngc build, perhaps, that is using too much memory.

Do you have any suggestions how can I proceed?

vella-nicholas commented 2 years ago

What is also interesting is that NGCC is picking up @angular/platform-browser-dynamic/testing as being a dependency of your application. This shouldn't be the case as this entry-point should only be used for testing purposes and setups.

Is there anyway I can remove this dependency from the main build? Because it does not make sense to me either.

vella-nicholas commented 2 years ago

The build works now. I achieved this by setting "sourceMap": false. I believe I have solved the issue like this.

petebacondarwin commented 2 years ago

Generating source-maps can be very memory intensive, since source-maps tend to be very large when being processed. The downside of turning this off is that exceptions and debugging in production code is less pleasant. But it should have no effect on the behaviour of the app.

vella-nicholas commented 2 years ago

Generating source-maps can be very memory intensive, since source-maps tend to be very large when being processed. The downside of turning this off is that exceptions and debugging in production code is less pleasant. But it should have no effect on the behaviour of the app.

I still believe this is not the optimal solution. Anything I can do to maybe profile this issue please?

petebacondarwin commented 2 years ago

You could try running the build locally via the Chrome devtools and doing some memory tracing. This might indicate how much memory is required and where it is occuring.

Is it possible to increase the resources available in your Cloud (even just temporarily) to see what amount of memory is needed?

vella-nicholas commented 2 years ago

You could try running the build locally via the Chrome devtools and doing some memory tracing. This might indicate how much memory is required and where it is occuring.

Is it possible to increase the resources available in your Cloud (even just temporarily) to see what amount of memory is needed?

I increased node memory on GCP to 8GB and the build did not complete after 3 hours. I will try Chrome devtools and post results.

vella-nicholas commented 2 years ago

You could try running the build locally via the Chrome devtools and doing some memory tracing. This might indicate how much memory is required and where it is occuring.

Is it possible to increase the resources available in your Cloud (even just temporarily) to see what amount of memory is needed?

What am I supposed to be on the look out for using DevTools? Individual components? Is there no way for me to measure how much memory various steps of the build take?

petebacondarwin commented 2 years ago

I was thinking you could view the "memory metrics" - see https://developer.chrome.com/docs/devtools/evaluate-performance/reference/#memory

clydin commented 2 years ago

From the version output in the original report, it appears that the @angular-devkit/build-angular package is outdated compared to the rest of the Angular CLI packages:

@angular-devkit/build-angular   12.1.1
@angular-devkit/core            12.2.10

The @angular-devkit/build-angular package contains the majority of the build pipeline. Can you try synchronizing that package's version with the others (all 12.2.10)?

vella-nicholas commented 2 years ago

From the version output in the original report, it appears that the @angular-devkit/build-angular package is outdated compared to the rest of the Angular CLI packages:

@angular-devkit/build-angular   12.1.1
@angular-devkit/core            12.2.10

The @angular-devkit/build-angular package contains the majority of the build pipeline. Can you try synchronizing that package's version with the others (all 12.2.10)?

I will try that thanks and get back to you with the result.

vella-nicholas commented 2 years ago

From the version output in the original report, it appears that the @angular-devkit/build-angular package is outdated compared to the rest of the Angular CLI packages:

@angular-devkit/build-angular   12.1.1
@angular-devkit/core            12.2.10

The @angular-devkit/build-angular package contains the majority of the build pipeline. Can you try synchronizing that package's version with the others (all 12.2.10)?

Updating this version seemed to have solved the problem. Many thanks! EDIT: Also for the record I used version 12.1.1 because it was the version auto updated with ng update.

alan-agius4 commented 2 years ago

Closing as issue is resolved as per above comment.

angular-automatic-lock-bot[bot] commented 2 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.