Skip to content

[Bug]: TypeError: compilation.namedChunkGroups is not iterable #7837

@VitaliyGuzun

Description

@VitaliyGuzun

System Info

System:
OS: macOS 14.6.1
CPU: (10) arm64 Apple M1 Max
Memory: 3.24 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.15.0 - ~/.volta/tools/image/node/20.15.0/bin/node
Yarn: 3.8.3 - ~/.volta/tools/image/yarn/3.8.3/bin/yarn
npm: 10.7.0 - ~/.volta/tools/image/node/20.15.0/bin/npm
pnpm: 9.9.0 - ~/.volta/bin/pnpm
Browsers:
Chrome: 128.0.6613.120
Safari: 17.6
npmPackages:
@rspack/cli: ^1.0.0 => 1.0.0
@rspack/core: ^1.0.0 => 1.0.0

Details

We are trying to iterate compilation.namedChunkGroups to generate a preload html file.
Docs says it is iterable but I get a TypeError while building

Reproduce link

https://github.com/VitaliyGuzun/iterate-namedChunkGroups/compare/main...iterate-namedChunkGroups

Reproduce Steps

  • Add an rspack plugin
  • Try to iterate through compilation.namedChunkGroups there
  • try to build pnpm run build
  • see an error [rspack-cli] [Error: × TypeError: compilation.namedChunkGroups is not iterable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpending triageThe issue/PR is currently untouched.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions