shama / webpack-stream

:tropical_drink: Run webpack through a stream interface
MIT License
1.4k stars 123 forks source link

Extract error messages from jsonStats errors #226

Closed poppa closed 4 years ago

poppa commented 4 years ago

Error messages from jsonStats errors was constructed by errors.join('\n') which resulted in a message like [object Object].

This fix tries to resolve the actual error message from error objects via some naive heuristics

poppa commented 4 years ago

Oh, one thing I forgot to mention is that the [object Object] error message was happening when using Webpack 5. In Webpack 4 the jsonStats.errors array is an array of strings.

This fix doesn't change the behaviour with Webpack 4 though, from what I have tested.

shama commented 4 years ago

Thanks!

snoack commented 4 years ago

Any chance to get this change released? We started using webpack 5 with webpack-stream which works like a charm, but if webpack fails it's difficult to debug because without the changes submitted here, errors are obfuscated.

shama commented 4 years ago

@snoack Sorry thought I already did. Released as 6.1.1.