Angular-cli: 92% after chunk asset optimization SourceMapDevToolPlugin vendor.js generate SourceMapKilled

Created on 20 Nov 2018  路  17Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x ] build
- [ x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions


node 10.13
npm 6.4.1

Repro steps


ng new my-app
ng serve

The log given by the failure

Desired functionality


92% after chunk asset optimization SourceMapDevToolPlugin vendor.js generate SourceMapKilled

Mention any other details that might be useful


In centos, it happened. But in windows, it is normal.

devkibuild-angular low investigation broken triage #1 bufix

Most helpful comment

Well, it appears to be an OOM issue. My test environment is on GCP. Once I bumped instance from micro (512MB RAM) to small (1.7G RAM). This problem disappeared.

Can't believe the fact that nowadays Javascript library requires that much resource to "compile"...

All 17 comments

Hi, can you share the versions you are using by running:

ng version

Angular CLI: 7.0.6
Node: 10.13.0
OS: linux x64
Angular:
...

Package Version

@angular-devkit/architect 0.10.6
@angular-devkit/core 7.0.6
@angular-devkit/schematics 7.0.6
@schematics/angular 7.0.6
@schematics/update 0.10.6
rxjs 6.3.3
typescript 3.1.6

@luther-nwpu does this happen with a brand new project on CentOS? Or just on your project?

I got the same problem, there is actually a webpack-contrib issue reported as well that might suggest this is a upstream issue:

https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/272

That has been said, I turned off both optimization and sourcemap flag in angular.json, but still got this error.

This is on a brand new project created through cli. This project was created on VM in cloud with only 1 vCPU and 512MB RAM. So, my guess is this is an OOM somewhere.

Angular CLI: 7.1.4
Node: 11.6.0
OS: linux x64
Angular: 7.1.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package Version

@angular-devkit/architect 0.11.4
@angular-devkit/build-angular 0.11.4
@angular-devkit/build-optimizer 0.11.4
@angular-devkit/build-webpack 0.11.4
@angular-devkit/core 7.1.4
@angular-devkit/schematics 7.1.4
@ngtools/webpack 7.1.4
@schematics/angular 7.1.4
@schematics/update 0.11.4
rxjs 6.3.3
typescript 3.1.6
webpack 4.23.1

Angular CLI: 6.0.8
Node: 10.12.0
OS: linux x64
Angular: 6.1.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cdk 6.4.7
@angular/cli 6.0.8
@angular/fire 5.0.2
@angular/flex-layout 6.0.0-beta.18
@angular/material 6.4.7
@ngtools/webpack 6.0.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.2
typescript 2.9.2
webpack 4.8.3
Even my build is getting broken

Well, it appears to be an OOM issue. My test environment is on GCP. Once I bumped instance from micro (512MB RAM) to small (1.7G RAM). This problem disappeared.

Can't believe the fact that nowadays Javascript library requires that much resource to "compile"...

same as @hellocomrade. upgraded from 1GB to 2GB RAM on digital ocean and it started working.

you'll soon need much more memory for sure. Unfortunately Angular builds need more and more gigabytes of memory as the project grows, especially when using AOT and differential loading. Also, Node.js has a default memory limit somewhere between 1 and 2 GB. So it's quite common to use this in Angular projects: node --max-old-space-size=8196 node_modules/@angular/cli/bin/ng build

Try this, worked for me:
ng serve --sourceMap=false

@byronglendon I've encountered this issue 10 minutes ago and your suggestion worked for me as well. Thanks!

Well, it saves my days! @byronglendon

Thanks you very much @byronglendon

@byronglendon wonderfull!

Closing as per explanation in one of the above comments https://github.com/angular/angular-cli/issues/13005#issuecomment-506068481

If the problem persists, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

Regarding that comment, you can provide a NODE_OPTIONS environment variable and you won't need to change your commands. I've added this to my ~/.bashrc:

export NODE_OPTIONS=--max_old_space_size=8192

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._

Was this page helpful?
0 / 5 - 0 ratings