Back to all fixes
CuratedTypeScriptVite 8local

Wrong tsconfig chosen with TypeScript project references, breaking path resolution

Problem

Resolve errors such as `[RESOLVE_ERROR] Error: Could not resolve '.storybook/preview'` or a `paths` mapping silently not applying, even though `resolve.tsconfigPaths: true` (or the tsconfig-paths plugin) is set correctly. Happens when a tsconfig.json has a `references` array but does not set `files: []` or `include: []`, so a source file is ambiguously matched by both the root tsconfig and one of its referenced sub-tsconfigs, and rolldown/tsconfck pick the wrong one (dropping that config's `paths`).

Solution

typescript
Fixed in rolldown via PR #9549 — upgrade to the rolldown/vite release containing that fix. For older versions, apply the standard TypeScript project-references fix: add `"files": []` (or `"include": []`) to the tsconfig.json that declares `references`, so it never matches source files directly and always defers to the referenced sub-project's tsconfig for path resolution.