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

[bug] `TypeError: Cannot read properties of undefined (reading 'filter')` when passing stats object

Open mjames-c opened this issue 4 months ago • 6 comments

Unfortunately, webpack-bundle-analyzer doesn't print an error stack trace so I don't know which property it is expecting that isn't present in the stats file. The top level keys in the stats JSON object are listed below:

cat <omitted>/webpack-stats.json | jq 'keys[]'
"chunks"
"entrypoints"
"errors"
"errorsCount"
"hash"
"namedChunkGroups"
"outputPath"
"publicPath"
"version"
"warnings"
"warningsCount"

cat <omitted>/webpack-stats.json | jq '.chunks[] | select(. != null) | keys[] | limit(1; .)' | sort
"auxiliaryFiles"
"children"
"childrenByOrder"
"entry"
"files"
"hash"
"id"
"idHints"
"initial"
"modules"
"names"
"origins"
"parents"
"recorded"
"rendered"
"runtime"
"siblings"
"size"
"sizes"

mjames-c avatar Aug 04 '25 01:08 mjames-c