Skip to content

[Bug]: When buildCache is enabled, encountering lazy import paths or barrel files causes a panic at runtime #9605

@starrnx

Description

@starrnx

Version

System:
    OS: macOS 15.3.1
    CPU: (12) arm64 Apple M3 Pro
    Memory: 3.06 GB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 134.0.6998.45
    Edge: 134.0.3124.51
    Safari: 18.3
  npmPackages:

Details

I need buildCache to solve the performance issue of hot updates in my large source code project, and I encountered the following error:

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 dependency
Location: crates/rspack_core/src/cache/persistent/occasion/make/module_graph.rs:85

Reproduce link

https://github.com/starrnx/rslib-panic

Reproduce Steps

Running pnpm run dev will result in the following error. The error will be resolved if the source code does not contain barrel files or React lazy imports. I am not sure if there are other situations that could cause a crash.

Image

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