See here: https://github.com/AngularClass/angular-starter/issues/1498
There are multiple reports of this but it comes down to the following changes to fix this:
Add --max_old_space_size=4096 to the node commands in the .csproj
update the following in the package.json:
"build:dev": "npm run webpack -- --progress --color",
"build:aot": "npm run webpack -- --env.aot --env.client & npm run webpack --env.aot --env.server",
"webpack": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js"
Very interesting, I haven't seen this one actually, if it works it might be a good addition to the repo! Want to put in a quick PR so everyone can have it? 馃憤 馃憤
Linked bug:
https://github.com/angular/angular-cli/issues/5618
It gets worse... I created a separate webpack.config.production.js to get around the chunking issue. If uglify-js is enabled this will fail with the above error even with 16 gb of memory allocated. (disabling it works but of course tree shaking, even the basics of it that do work doesn't happen and you end up with massive files.)
Its still an open issue with Angular team, https://github.com/angular/angular/issues/12184 and probably the solution currently is to increase max_old_space_size. It would be better to add it in docs because some times you will have to increase the max_old_space_size even from 4096.
Feel free to re-open if you encounter this issue, for now i'm going to close the issue, since we can't really control this one.
This issue hits hard on Azure Agent builds more often. A possible resolution using an npm package is listed here: https://developercommunity.visualstudio.com/content/problem/398343/azure-devops-pipeline-fatal-error-ineffective-mark.html