-
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
Compiling in production fails silently and isn't verbose enough #1824
Comments
FontAwesome did a writeup on this known issue. Issue terser/terser#50 There is a merged webpacker PR to fix this |
Thank you @jakeNiemiec, I don't know if also my issues are related to |
|
@jakeNiemiec are you sure that that is what it's happening? Why moving the libraries from |
Yeah, we should fix this. Thanks @ameft for reporting. Please feel free to make a PR |
@ameft Sorry, my mistake, I conflated some of the issues you pointed to with what you were saying. Now my understanding is: FA was in It looks like webpacker is configured correctly to display errors:
You should also be able to pass custom settings to ensure errors are being displayed. Here is what I am currently using: stats: {
errors: true,
errorDetails: true,
colors: true,
optimizationBailout: true
} Edit: @ameft if you wanted to make the PR, I think adding back the line that this commit removed might solve this problem: #483. (errorDetails should be shown with or without the |
I'll try the stats config and to revert the fix to see if the errors are displayed, thank you @jakeNiemiec! |
@jakeNiemiec I think the issue here is |
A thing I've had to recommend fairly frequently is to manually run Can we make this the default output mode of webpacker? Any other documentation or tips on debugging hung or really slow compiles is appreciated. |
@schneems If you also add We use a progress plugin that does this on every build, here is one that a lot of |
+1 to what @schneems said above with respect to making |
I do not know about that no error output will occur, but this is maybe related #2143 |
@ameft Can this issue be closed and, if so, could you close it? Thank you! |
@rossta I can of course close the issues, but it's not entirely clear to me if now webpacker behaves differently if it encounter certain errors during compiling. I didn't had any more issue on my part but I don't know if the original issue is actually addressed or maybe it's not a real issue to begin with... |
@ameft Ah, thanks for pointing that out. It's my understanding that Webpacker suppressed the compilation output in the version associated with this issue (Webpacker 4.0.0.pre.3 from the description). Since 4.1.0 with this PR #2224, Webpacker will now print the compilation output to STDOUT by default though this behavior can be disabled in webpacker.yml
|
@rossta amazing thanks! Issue closed :) |
I have a Rails 5.2 app with Webpacker 4.0.0.pre.3 with runs smoothly in development and instead couldn't compile in production:
[Webpacker] Compiling…
just hanged there for hours (locally and on Heroku, where @schneems helped me a lot), in a similar way as described in #1534, #1217 and #1003.After many hours of testing and research I found out that the problem was that two dependencies in
package.json
(@fortawesome/fontawesome-free and expose-loader) were indevDependencies
instead ofdependencies
, that made compiling failing silently.Running this command put me on the right path to find the solution, giving me some hits of errors
NODE_ENV=production ./bin/webpack --progress --config config/webpack/production.js
.Problem is that instad running
RAILS_ENV=production NODE_ENV=production bundle exec rails assets:compile
didn't give me any indication of errors, and I don't know why but shouldn't be the case.What do you think?
The text was updated successfully, but these errors were encountered: