Skip to content

[Bug]: corrupt persistent-cache module graph recovery panics #14858

Description

@hardfist

Reproduction

Repository: https://github.com/hardfist/rspack-persistent-cache-make-recovery-repro

This is a Node-level repro using the public @rspack/core compiler API. It pins the latest published package at the time of filing, @rspack/core@2.1.4; it does not build or call Rspack's Rust crates.

Run:

pnpm install
pnpm repro

The script creates a real filesystem persistent cache, corrupts the first value in occasion_make_module_graph/0.pack, recomputes that pack's integrity hash, and starts a fresh Rspack process against the cache.

On @rspack/core@2.1.4, the child aborts with:

unexpected module graph deserialize failed

The parent reports BUG REPRODUCED and exits 0.

Expected behavior

A malformed persistent-cache entry should return a recovery error so the cache context can invalidate/reset that scope. It should not abort the process.

Environment

  • @rspack/core@2.1.4
  • Node.js 24.16.0
  • macOS arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions