-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Error messaging when running rake assets:precompile #1677
Comments
|
This appears to be a bug (because all of the debugging information is on stdout instead of sterror, the latter of which is being printed), but an easy workaround (after MUCH searching for it) is to set the following key in your webpacker.yml:
In my case, I was compiling assets for production, so it looked something akin to this:
|
Relavent line: webpacker/lib/webpacker/compiler.rb Lines 79 to 81 in 195396f
I think there should be more logging, but there is strong disagreement over how much logging should be shown by default: #955 (comment) |
Underlying this is webpacker only reports stderr, on the assumption that webpack itself reports errors on stderr. Instead it reports (some ? all ?) errors on stdout. Either webpack itself needs correcting to report errors on stderr, or the stdout content needs to be included in the logging since it may contain the errors. |
This is a really good point. The mismatched expectations is the root cause. The workaround I provided took advantage of the fact that The expectation here seems to be that errors show on stdout. Since that expectation is wrong, reevaluating the expectation seems logical to me. |
Ran into this today. I had a broken config due to the unavailability of an import from I then cross-referenced with running
Sure enough,
I would have expected Personally I think they should change things, but if they don't I would expect webpacker's |
@jackkinsella Can you check if the issue was fixed with #2190 |
@jakeNiemiec Have confirmed — it's fixed on master/head. Awesome stuff! |
When running rake assets:precompile if the compile has any issues you don't get any feedback or error messaging.
To give you a bit more info I had accidentally added a package to dev dependencies, so when I ran:
NODE_ENV=production rake assets:precompile
Because the compile step brings in fresh packages and if you specify NODE_ENV=production it won't include the devDependency (or doesn't seem too). The compile was failing because the package couldn't be found. This is fine except the compile step just hung no errors just said compiling...
When I eventually tried:
NODE_ENV=production ./bin/webpack
I realised what the issue was as all the error messages appeared.
What would be handy is if there are any errors in the compile it displays so you can pick up on them faster.
Also whether a way to disable fresh package import might be handy? I find if I compile locally for production I always have to re-install my dev packages. Something like:
NODE_ENV=production rake assets:precompile --no-install
Would be very handy.
The text was updated successfully, but these errors were encountered: