You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stats parsing is broken when using "all: true" and Webpack 5 #417
functionassetHasModule(statAsset,statModule){// Checking if this module is the part of asset chunksreturnstatModule.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/[email protected]/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.
Thanks for the issue! This might be a regression stemming from #395 where the assetHasModule previously used lodash's _.some method, which likely works better when the value given in is undefined.
Activity
valscion commentedon Feb 17, 2021
Thanks for the issue! This might be a regression stemming from #395 where the
assetHasModulepreviously used lodash's_.somemethod, which likely works better when the value given in isundefined.Fixes webpack#417 missing module chunks
Fixes webpack#417 missing module chunks
Fixes #417 missing module chunks (#433)
valscion commentedon Apr 13, 2021
Should be fixed in v4.4.1, thanks to @deanshub via #433. Let us know if the fix works for you☺️
npm publish and upstream fetch (#2)