-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Deadlock when asynchronous error happens on make
#3464
Comments
The expected behavior is to show the error and quit, because this is a crititcal error. Throwing an error is not allowed in a async plugin hook, node should crash here. We can't start watching as we don't know which files to watch. The Notes to me: https://github.com/webpack/webpack/blob/master/lib/Compiler.js#L97-L98 https://github.com/webpack/webpack/blob/master/bin/webpack.js#L296 add https://github.com/webpack/webpack/blob/master/bin/webpack.js#L304 remove the condition Notes to @SpaceK33z The dev-middleware should error when the The dev-server should quit. |
@sokra What would be the recommended way to trigger an error during code generation, but not kill the build. Basically, we know code generation in our case might fail but since we're only adding new code it doesn't matter for the dependency graph of Webpack and we know we can rebuild when a file changes. |
I'm going to try to succeed the |
All errors passed to the callback from |
Reporting a bug
It seems that asynchronously calling the callback with an error during the
make
step causes a deadlock 100% of the time. This was diagnosed in the webpack-dev-middleware (see webpack/webpack-dev-middleware#156), but it seems that it's happening deeper into webpack, as the issue happens without that plugin.Also, if the error happens synchronously, the watch process simply exits even if it shows
Webpack is watching the files…
.Reproduction
Cloning this project (random webpack 2 seed), and applying this patch:
When doing
webpack --watch
it will show the error, continue the compilation, then block at 70%, never exit and doesn't rebuild when a file changes.Changing the error plugin to be synchronous will result in the watcher quitting, which is also not what we want.
The text was updated successfully, but these errors were encountered: