Angular CLI: 1.6.1
Node: 9.3.0
OS: darwin x64
Angular: 5.1.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.6.1
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.1
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack: 3.10.0
ng serve or ng build; app runs and builds fine.ng build --prod and get error.ng build --prod --sourcemaps and build fails silently. I'm running into the bug that I've seen mentioned elsewhere (#7509), where building in production mode fails at the Uglify step with this error:
ERROR in main.e2a4502596f798d8da48.bundle.js from UglifyJs
Unexpected token: punc ()) [main.e2a4502596f798d8da48.bundle.js:19927,4]
That it's happening in the main bundle makes me think it's my code, so I was trying to enable sourcemaps to track it down, as recommended here. However, when I enable sourcemaps, the build just quietly fails with no error message, but also no dist directory. 馃槶 Even with the --verbose flag, I don't see anything particularly useful -- it just gets up to 92% chunk asset optimization and then dies. (The process even exits with a 0 code!)
%> ng build --prod --sourcemaps --verbose
10892ms building modules
4ms sealing
1ms optimizing
0ms basic module optimization
8ms module optimization
12ms advanced module optimization
2ms basic chunk optimization
0ms chunk optimization
1ms advanced chunk optimization
219ms building modules
0ms module and chunk tree optimization
8ms chunk modules optimization
1ms advanced chunk modules optimization
0ms module reviving
7ms module order optimization
2ms module id optimization
0ms chunk reviving
3ms chunk order optimization
3ms chunk id optimization
47ms hashing
1ms module assets processing
468ms chunk assets processing
1ms additional chunk assets processing
1ms recording
0ms additional asset processing
92% chunk asset optimization%
%> echo $?
0
%> ls dist
gls: cannot access 'dist': No such file or directory
I'd like to be able to generate sourcemaps to see where the problem is being introduced, or at least see an error message as they fail.
I kept getting the same error (at 92% as well) but I think it may have been solved now that I upgraded to CLI 1.6.3 note
Please try updating the project to the latest CLI version (1.6.3). Also, if the problem persists after an upgrade please provide the output of npm ls uglify-es.
Fixed in latest cli.
It is --source-map now not --sourcemaps so I don't know how is it working for you guys especially when you update the CLI to 6+
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._