RoccoC / webpack-build-notifier

A Webpack plugin that generates OS notifications for build steps using node-notifier.
MIT License
162 stars 24 forks source link

Plugin crashes when child compiler has errors #53

Closed meskill closed 4 years ago

meskill commented 4 years ago

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 commented 4 years ago

Thanks for the report.

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

meskill commented 4 years ago

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

RoccoC commented 4 years ago

@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. 👍