LoginSignup
4
3

More than 3 years have passed since last update.

railsでasset:precompileが落ちて、デプロイ失敗するけどエラーログが特に出ないときどうするか

Posted at
  • asset:precompileが落ちて、デプロイ失敗する
  • エラーログが特に表示されない
  • webpackerの仕様asset:precompile時にwebpacker:compileがフックされる。その中で落ちていた
  • webpack-dev-serverではcompile成功していた
  • ローカルでbin/rails webpacker:compile --verboseしても処理が終わらず、エラーはいてくれない。
  • ローカルでbin/webpack --verboseするとちゃんとエラー吐いてくれた。これでどこで落ちてるかわかる。 ERROR in js/xxx/index-0b032e49757fa3df8c0d.js from UglifyJs Unexpected token: name «o», expected: punc «;» [js/xxx/index-0b032e49757fa3df8c0d.js:1,12082]

まとめ

  • webpack-dev-serverでcompile成功していても、デプロイ時に失敗することがある
  • bin/webpack --verboseするとローカルでもデバッグできるしエラーはいてくれる
4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3