Skip to content

Fix error messages for child compilations #6286

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

Closed
wants to merge 1 commit into from

Conversation

jamesknelson
Copy link
Contributor

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 compiler object'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, but react-dev-utils was not seeing this as formatWebpackMessages() only looks at jsonStats.errors, but ignores jsonStats.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.

@stale
Copy link

stale bot commented Feb 26, 2019

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.

@garrettjstevens
Copy link

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 jsonStats.errors, but does show up in one of jsonStats.children[i].errors (which ends up causing the build to silently fail).

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.

@nickretallack
Copy link

I'm running into this problem with worker-loader as well. Can we get this patched in soon?

@nickretallack
Copy link

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.

@kanasite
Copy link

any update on this ? @iansu

@Cyral
Copy link

Cyral commented Nov 19, 2020

Also running into this with worker-loader where the messages are silently captured and nothing is emitted

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

Successfully merging this pull request may close these issues.

8 participants