Skip to content

[Bug]: Persistent cache causes panic when used with require.extensions #9278

@Thiry1

Description

@Thiry1

System Info

System:
OS: macOS 14.7
CPU: (8) arm64 Apple M2
Memory: 151.89 MB / 24.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 22.13.1 - ~/.nodebrew/current/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 10.9.2 - ~/.nodebrew/current/bin/npm
pnpm: 9.15.4 - ~/.nodebrew/current/bin/pnpm
bun: 1.0.2 - /opt/homebrew/bin/bun
Browsers:
Chrome: 133.0.6943.98
Chrome Canary: 135.0.7014.0
Edge: 133.0.3065.59
Safari: 18.0
npmPackages:
@rspack/cli: ^1.2.3 => 1.2.3
@rspack/core: ^1.2.3 => 1.2.3

Details

Persistent cache causes panic when used with node-config.
After some investigation, I've found that require.extensions is the root cause. see: #9278 (comment)

Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message:  should have module graph module
Location: crates/rspack_core/src/compiler/make/cutout/fix_issuers.rs:20

Reproduce link

Thiry1/rspack-bug-repro@38eab02

Reproduce Steps

  1. clone repro repo
  2. run git switch persistent-cache-bug
  3. run pnpm i
  4. run pnpm run -r build
  5. run pnpm run -r build again

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions