webpack-bundle-analyzer icon indicating copy to clipboard operation
webpack-bundle-analyzer copied to clipboard

No such label 'done hook' for WebpackLogger.timeEnd()

Open NexxLuo opened this issue 4 years ago • 6 comments

webpack v5.70.0 webpack-bundle-analyzer v4.5.0 new BundleAnalyzerPlugin()

QQ图片20220322151534

NexxLuo avatar Mar 22 '22 07:03 NexxLuo

I also have this issue when using webpack compiler in js, but not in CLI. If the compilation fails (compiled with some errors), we have this Fatal error instead of a normal compilation failure.

ArTiSTiX avatar Oct 14 '22 09:10 ArTiSTiX

Are you able to create a reproduction repository showing this error happening?

valscion avatar Oct 14 '22 10:10 valscion

In fact i was able to find the exact case why this is happening.

In the Webpack run callback, if something throws it will trigger this error.

Ex:

const webpack = require('webpack');
const config = require('./config');
const compiler = webpack(config);

compiler.run((err, stats) => {
  throw new Error('something');
});

If the WebpackBundleAnalyzer is configured, it should trigger this error.

ArTiSTiX avatar Oct 14 '22 11:10 ArTiSTiX

Adding a test that asserts the error thrown during compiler run would be a nice addition! Bonus points if the issue can be fixed, too

valscion avatar Oct 14 '22 15:10 valscion

@valscion The error message seems to be from Webpack logger. Can you pls brief what kind fix is expected here?.

amareshsm avatar Nov 19 '22 18:11 amareshsm

I don't really know what is the expected outcome to be honest 😅. What's the output if this same error is triggered but webpack-bundle-analyzer is not in the plugins list? Does webpack output the error in a nicer way that time?

valscion avatar Nov 21 '22 12:11 valscion