Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset compile hangs on [Webpacker] Compiling assets #1217

Closed
Praneeta opened this issue Jan 25, 2018 · 7 comments
Closed

Asset compile hangs on [Webpacker] Compiling assets #1217

Praneeta opened this issue Jan 25, 2018 · 7 comments

Comments

@Praneeta
Copy link

Trying to run NODE_ENV=production RAILS_ENV=development bundle exec rake assets:precompile --trace locally
It basically hangs at [Webpacker] Compiling assets 🎉
I cannot really tell what it's doing then.
I checked my output path packs. The files are generated but are completely empty.
Any suggestions?

I had trouble running webpacker, needed to increase the allocated memory - more about that in #1189 .

@catskull
Copy link

Compiling assets could take a very long time. How long have you let it run?

@gauravtiwari
Copy link
Member

@Praneeta Ahh I see, could you run this locally and see what happens:

NODE_ENV=production ./bin/webpack --progress --config config/webpack/production.js

@gauravtiwari
Copy link
Member

Also, how big is the app? Is it using angular? And how are the entry points structured i.e. what do you have in the packs folder?

@Praneeta
Copy link
Author

Praneeta commented Jan 29, 2018

@gauravtiwari Thanks for the tip on running it directly. Seems like uglifying the files is slowing (@catskull - it did not finish under 30 mins, then I stopped it.) the process.
If I comment the uglify plugin from config/production.js, it compiles in 4 mins.
My app is rather large (179 files) because I am trying to make it so that each page in the app (not a single page app) has it's own js file and there is only 1 script tag per page. But seems like this is causing the asset compile process to take forever. I will try to pull common code into chunks and have 2 script tags per page - common_chunk.js and page_specific.js

@Praneeta
Copy link
Author

webpack.optimize.CommonsChunkPlugin was a huge help. Cut down the compile time under 5 mins. With the right config, can it get it as low as a minute.

@gauravtiwari
Copy link
Member

gauravtiwari commented Jan 30, 2018

Great 👍 Yeah you can try DLL plugin for further speed optimisation: https://webpack.js.org/plugins/dll-plugin/

Example: #702

@hiveer
Copy link

hiveer commented Mar 16, 2020

In my case, I have to set check_yarn_integrity: false for 'development' in config/webpacker.yml.
Otherwise you're stuck because of an integrity error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants