Show empty page
Console show "No bundles were parsed. Analyzer will show only original module sizes from stats file"
Browser console show nothing
I use this as plugin
Here is stats file stats.json.zip
Same issue, one caveat is that I'm using ESM .mjs files if that has any impact. A JS bundle is still created however.
I also ran into this and did some debugging.
In my case, it was happening because we were gzipping our assets (with CompressionPlugin) which, from what I understand, changed the filenames from .js to js.gz.
The bundle analyzer removes all non-js or mjs files here:
https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/a99fc910920c7220700d6ddbb79c556a31e9e201/src/analyzer.js#L33-L40
As a workaround, I disable our gzipping when analyzing the bundle. I don't think this is an issue with webpack-bundle-analyzer.
@samkelleher — That was fixed 6 days ago in https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/252.
Thanks for providing the stats.json @s524797336. The critical parts look like this:
{
"assets": [
],
"children": [
{
"assets": [
{
"name": "__child-HtmlWebpackPlugin_0",
"size": 711481,
"chunks": [
0
],
"chunkNames": [
"HtmlWebpackPlugin_0"
],
"emitted": false
}
]
}
]
}
Because children[0].assets array's .name does not end up in .js or .mjs, webpack-bundle-analyzer skips parsing your entire bundle.
I don't know what causes the name to not have a .js ending, so I'm afraid I can't help you any further than this.
If i stop using gzip, this works fine, so i don't think this is what happened.
I had the same issue. After quite some time I found out, that someone set stats: 'errors-only', in our webpack.config.js.
See https://webpack.js.org/configuration/stats/.
Using stats: 'normal solved it for me.
anyone figured out a solution yet? sucks that it doesn't analyze gzipped bundles
webpack-bundle-analyzer does support gzip. Please open a new issue to describe your situation in more detail @RedVelocity
Oh yeah, true, if you compress assets, turning output to gzip files, that indeed doesn't work. A new issue specifically about that feature missing would be helpful if anyone's willing to write up such an issue as a feature request ☺️
EDIT: Here's the new issue written by @RedVelocity 💞 https://github.com/webpack-contrib/webpack-bundle-analyzer/issues/377
Most helpful comment
I had the same issue. After quite some time I found out, that someone set
stats: 'errors-only',in our webpack.config.js.See https://webpack.js.org/configuration/stats/.
Using
stats: 'normalsolved it for me.