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

Plugin crashes when child compiler has errors #53

Closed
meskill opened this issue Jun 18, 2020 · 3 comments
Closed

Plugin crashes when child compiler has errors #53

meskill opened this issue Jun 18, 2020 · 3 comments

Comments

@meskill
Copy link

meskill commented Jun 18, 2020

Some other plugins can create child compilers (for example extract-css-chunks-webpack-plugin) which will lead to a crash with errors like this

TypeError: Cannot read property 'module' of undefined
    at WebpackBuildNotifierPlugin.onCompilationDone

if that child compiler has errors or warnings

This is happening due to the code inside webpack.Stats.hasErrors which checks errors also inside child compilers.

To fix the issue we need to extract errors and warnings also from child compilers if there are no errors in the current one.

@RoccoC
Copy link
Owner

RoccoC commented Jun 18, 2020

Thanks for the report.

Can you please provide a simple reproduce case for this scenario?

meskill added a commit to meskill/webpack-build-notifier that referenced this issue Jun 20, 2020
@meskill
Copy link
Author

meskill commented Jun 20, 2020

@RoccoC
You can see reproduce for test cases here https://github.com/meskill/webpack-build-notifier/tree/bug-reproduce

RoccoC added a commit that referenced this issue Jun 23, 2020
* Upgraded all depepndencies to latest

* Updated CI script.

* Configured travis for node@10.

* Added warning/error handling for child compiler instances (#53).

* Updated version
@RoccoC
Copy link
Owner

RoccoC commented Jun 23, 2020

@meskill , this has been fixed in v2.1.0.

Thanks for the bug report and reproduce case -- do let me know if you run into any issues with the latest release. 👍

@RoccoC RoccoC closed this as completed Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants