-
-
Notifications
You must be signed in to change notification settings - Fork 779
Description
System Info
System:
OS: macOS 15.6 (Darwin 24.6.0)
CPU: ARM64 (Apple Silicon)
Binaries:
Node: v20.18.0
npm: 10.8.2
Relevant packages:
@rspack/cli: ^1.1.8
@rspack/core: ^1.1.8
typescript: ^5.7.2
ts-node: ^10.9.2
Details
When using Rspack's experimental persistent cache feature with TypeScript configuration files, the build logs a warning about being unable to resolve relative imports within the config directory:
LOG from rspack.persistentCache
<w> BuildDependencies: can't resolve ./util in /Users/airadian/rspack-repro/rspack.
<w> - NotFound("./util")
This occurs even though:
- The TypeScript import (
import { BogusPlugin } from './util';) works correctly inrspack/rspack.config.ts - The build completes successfully
- The file
rspack/util.tsexists and is valid
The warning appears when:
- Running the first build with no cache
- After clearing the cache directory (
node_modules/.rspack) and re-running it
Reproduce link
https://github.com/Armine-i/rspack-repro/tree/mina-repro
Reproduce Steps
git clone https://github.com/Armine-i/rspack-repro.git
cd rspack-repro
npm install
rm -rf node_modules/.rspack
npm run buildThe warning will appear in the console output.
Important: It only logs when there's no cache or if it's invalidated. Run rm -rf node_modules/.rspack before building to reproduce.
Expected Behavior
The persistent cache's buildDependencies feature should correctly resolve TypeScript relative imports (e.g., ./util) within the tracked directory without logging warnings.
Actual Behavior
A NotFound("./util") warning is logged during the build, suggesting the cache system cannot resolve the TypeScript import even though the file exists and TypeScript compilation succeeds.