Created by: jamesknelson
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.