Back to all fixes
CuratedTypeScriptVite 8local

Vite 8 fails to resolve modules through Yarn PnP global cache folder on a different drive

Problem

`Error: [vite]: Rolldown failed to resolve import "react-dom/client" from ".../src/rect/index.jsx"` during `vite build` when using Yarn PnP with a global cache (`enableGlobalCache: true`, the default), especially when the global cache folder lives on a different path/drive than the project (e.g. project on D:\ and cache on D:\.cache, or a system-drive mismatch on Windows). Works fine with Vite 7.

Solution

typescript
Workaround confirmed by the reporter: disable Yarn's global cache for the project via `.yarnrc.yml`: `enableGlobalCache: false`. This forces packages into the project-local `.yarn/cache` where Rolldown's resolver works correctly, at the cost of losing the disk-space/CI-time benefit of a shared global cache. No Vite-side fix exists yet for resolving through the global cache path correctly.