Hello!
Thank you for this great tool!
Issue description
However, I've encountered a situation when stats file parsing is broken when using the following stats configuration:
const statsConfig = {
all: true,
context: projectPath,
source: false,
}
and Webpack 5.22.0.
Technical info
The problem is in the assetHasModule function:
function assetHasModule(statAsset, statModule) {
// Checking if this module is the part of asset chunks
return statModule.chunks.some(moduleChunk => statAsset.chunks.includes(moduleChunk));
}
It raises the following error:
TypeError: Cannot read property 'some' of undefined
because statModule.chunks is undefined in this case.
In my example the module stat object has the following structure:
{
"type": "modules by path",
"name": "…node_modules/.pnpm/core-js@3.8.3/node_modules/core-js/internals/*.js",
"children": [
// A big list of modules here
],
"size": 22868,
"sizes": {
"javascript": 22868
}
}
Also, when I change the stats config to use "verbose" preset, the error goes away, but when I view the bundle layout in "parsed" format, it only renders the entry point module. I think something is broken on a more fundamental level.
I've uploaded the obfuscated version of my stats.json file generated with the latest version of the Webpack using "verbose" preset.
Hello!
Thank you for this great tool!
Issue description
However, I've encountered a situation when stats file parsing is broken when using the following stats configuration:
and Webpack
5.22.0.Technical info
The problem is in the assetHasModule function:
It raises the following error:
TypeError: Cannot read property 'some' of undefinedbecause
statModule.chunksisundefinedin this case.In my example the module stat object has the following structure:
Also, when I change the stats config to use "verbose" preset, the error goes away, but when I view the bundle layout in "parsed" format, it only renders the entry point module. I think something is broken on a more fundamental level.
I've uploaded the obfuscated version of my stats.json file generated with the latest version of the Webpack using "verbose" preset.