webpacker: Compiles fail with no output
From https://github.com/heroku/heroku-buildpack-ruby/issues/562
I’m getting a non-trivial number of people getting compile failures, but with no debug output of any kind. Here’s an example:
remote: Webpacker is installed 🎉 🍰
remote: Using /tmp/build_c3975d9e573c1bf0b4e6b532daa48fde/config/webpack/paths.yml file for setting up webpack paths
remote: Compiling webpacker assets 🎉
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy....
remote:
remote: ! Push rejected to [my app].
Is there anything else we can do when this happens? Any way to add debug info? Maybe toggle an environment variable for extra logging?
Have you seen silent failures like this before? Any ideas?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 14
- Comments: 64 (24 by maintainers)
Commits related to this issue
- Try to compress warnings for webpack. Idea from https://github.com/rails/webpacker/issues/395#issuecomment-310164523 — committed to dailydrip/formulae_example by knewter 7 years ago
- Include built code with the release. This is hopefully a temporary fix, as the stock rails/webpacker config using Uglifyjs is not able to compile code that is ES6. Relevant issues: https://github.co... — committed to moser-inc/rails-validator by gregawoods 7 years ago
- POSSIBLE FIX? ran yarn add babel-preset-babili per issue https://github.com/rails/webpacker/issues/395\#issuecomment-304044400 — committed to dschmura/rock by dschmura 6 years ago
Failed with no output:
I am getting similar issues and have tried related things in this thread.
I have been purging my cache and verything compiles fine when running locally
NODE_ENV=production RAILS_ENV=production rails assets:precompile --trace
Is there anyway to find where the error is?
@shaun965 In
config/webpack/production.js
I setwarnings: true
for the compress setting of the uglify plugin and ended up getting verbose error logging during the compilation process.@thisiserik try running
assets:precompile
locally to see what error you get:thanks @flybayer, memory was the issue here. I increased instance, and it worked. I also measured while compiling, it took up to ~800mb of ram…
Could you add this to your
package.json
and try deploying again?Strange that you don’t get any error output.
@schneems Yepp, I have seen it before and most probably it’s related to
node-sass
binary either not available or corrupted - related to https://github.com/sass/node-sass/issues/1918One more thing I noticed and mentioned in (https://github.com/rails/webpacker/issues/169#issuecomment-288296033) was that with regular ruby buildpack
npm
isn’t available alongside yarn. I think it would be useful to have that too on heroku.I think this is a bug we need to fix for compile task. Currently we are using a non-standard way to get output from webpack compile task, which is unhelpful for debugging. I started adding js scripts in #264. Perhaps, I can just make a PR with only scripts so it improves the debugging workflow.
@bajalovic I’ve had that killed error before. The problem was not enough system resources. Restart your server and try again. Maybe stop any other running apps as well. If it still fails, upgrade your server.
No worries!
Nice! Yepp that’s another to solve this, totally forgot 👍 Basically the problem is
vue-scrollTo
has es6 code, which isn’t being compiled by babel-loader sincenode_modules
are ignored. Will add this to README 👍 until we start using es6-aware minifier.@schneems at the moment if the users need to use npm for anything for ex -
npm rebuild node-sass
using post-install hook, thenpm
binary isn’t available on heroku on ruby buildpack with webpacker. It is available innode-js
build-pack though. Might make sense to have npm too if heroku has yarn support with webpacker?BTW, fixed the debugging issue on master so, now compile task will provide much better debug output if
assets:precompile
fails because of webpacker.Ref- #403
Now precompiling is failing every single time regardless of cache state, including the exact code I was using the other week in a brand new dokku app. * scratches head *
Precompiling locally in production mode works flawlessly.
Thanks for filing this, Richard.
@flybayer Which version of webpacker are you using? Master branch? Can I confirm it’s rails 5.1.0 and not 5.1.1? @fuffi Same question to you