webpack / webpack/webpack-bundle-analyzer

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

Open
#669 6 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: Needs triage
Dominant language
JavaScript
Stars
12.7k
Forks
514
Avg merge
6d 2h
Merged PRs (30d)
4

Description

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"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified in the report. Start by reproducing the TypeError with the supplied stats JSON and inspect the listed top-level and chunk keys; done means passing the stats object no longer causes an undefined.filter failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.