Fix error messages for child compilations#6286
Conversation
|
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
|
I think the example on issue #8014 could serve as a simple reproduction for this. It uses workerize-loader, and an eslint error in the webworker file doesn't show up in Is there anything I can do to help with this PR? I've run into webpack child compilation problems a few times and would love to see this merged. |
|
I'm running into this problem with worker-loader as well. Can we get this patched in soon? |
|
Since this PR is taking too long to land, I'm just patching in frankXu's change from the linked issue. I'm using patch-package. |
|
any update on this ? @iansu |
|
Also running into this with worker-loader where the messages are silently captured and nothing is emitted |
While working with an app that was ejected from create-react-app some time ago, I ran into an issue where the terminal was giving me the usual "Compiled successfully! You can now view cra in the browser." message, while actually opening the app in the browser was resulting in a "Cannot find /" message.
Further investigation showed that the Webpack
compilerobject's output filesystem object was empty, as if the build was failing. In fact, the build of a child compilation for a worker was failing, butreact-dev-utilswas not seeing this asformatWebpackMessages()only looks atjsonStats.errors, but ignoresjsonStats.children[i].errors.Updating
formatWebpackMessages()to take child compilation errors into account solved the problem, with the "Compiled successfully!" message being replaced with the error that was causing compilation to fail.Unfortunately, I've spent a couple hours trying to put together a simple reproduction that demonstrates the error outside of my old project, but have not been able to reproduce the error. I figure I should submit this anyway in case anybody else does find the error, as I lost most of the day to it. If nobody else is able to reproduce (and you don't merge it anyway), I'll try and spend a couple more hours on my own reproduction.