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

Webpacker::Compiler swallows stdout in the event of failed compilation #2190

Closed
jebw opened this issue Jul 17, 2019 · 2 comments · Fixed by #2224
Closed

Webpacker::Compiler swallows stdout in the event of failed compilation #2190

jebw opened this issue Jul 17, 2019 · 2 comments · Fixed by #2224

Comments

@jebw
Copy link

jebw commented Jul 17, 2019

In the event of a failed compilation Webpacker::Compiler#run_webpack will swallow the output of stdout and only show the output of stderr.

If webpack is incorrectly outputting on StdOut, as seems to be the case with a missing node module, then the user just see's a blank error with no further information

Compilation failed:

Happy to submit a patch to resolve this - not sure on the best approach? Options I can think of are

  1. Extend line L71 to something like
logger.error "Compilation failed:\n#{stdout}\n#{stderr}"
  1. Log the stdout to a different level in the logger
logger.error "Compilation failed:\n#{stderr}"
logger.debug "#{stdout}"

Thanks

@jakeNiemiec
Copy link
Member

Slightly related: #1677

@botanicus
Copy link
Contributor

I can confirm that this indeed occurs frequently (the last case was when I by accident declared already declared const) as well as that solutions proposed by @jebw do indeed fix it.

I'm also happy to submit patch, but don't want to steal @jebw's credit.

I suggest this to be treated as a high priority bug, because it makes webpacker pretty much useless.

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

Successfully merging a pull request may close this issue.

3 participants