angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng build --prod --aot --output-hashing none stuck at chunk asset optimization after Angular V 5 upgrade

Open rahulrsingh09 opened this issue 9 years ago • 25 comments

After Upgrading to Angular Version 5 the aot compilation seems to be stuck at 92 % chunk Optimisation for ages. and Completes after a full 4 mins

Date: 2017-11-03T13:54:26.604Z
Hash: 35cf6c5f7a300435f807
Time: 222890ms
chunk {0} 0.chunk.js () 16.7 kB  [rendered]
chunk {1} main.bundle.js (main) 2.56 MB [initial] [rendered]
chunk {2} polyfills.bundle.js (polyfills) 63.8 kB [initial] [rendered]
chunk {3} styles.bundle.css (styles) 296 kB [initial] [rendered]
chunk {4} inline.bundle.js (inline) 1.36 kB [entry] [rendered]

Any reason for this slowness

rahulrsingh09 avatar Nov 04 '17 15:11 rahulrsingh09

If you're stuck at 92%, try commenting out any [styleUrls] in your components and see if that makes a difference. I was experiencing that and switched to linked stylesheets because when I removed my [styleUrls], it completed the build.

clabough avatar May 09 '18 15:05 clabough

I was having the same issue (my build was stuck at 92% and taking around 18 minutes to complete...) I increased memory allocation for node and also disabled some options in the build command this way:

node --max_old_space_size=5048 "%~dp0..@angular\cli\bin\ng" build --prod --source-map false --build-optimizer false --aot false

This way my build only takes 33 seconds. Hope this help you pass that 92% chunk optimization faster.

migerusantte avatar Jun 13 '18 14:06 migerusantte

@abhinavJai........ Thank you it works for me.

harshasaha avatar Jun 25 '18 09:06 harshasaha

Closing as there haven't been any additional reports for this problem recently, and I cannot reproduce it as well. If you are still experiencing this problem please open a new issue with a reproduction.

filipesilva avatar Jan 28 '19 16:01 filipesilva

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.