Back to all fixes
CuratedTypeScriptVite 8local

"Failed to resolve dependency" for a package listed in optimizeDeps.include, under Yarn PnP

Problem

Under Yarn PnP, a dependency explicitly listed in `optimizeDeps.include` still fails to resolve during the dependency-scan/optimize step, throwing a resolution error even though the package is present and declared. Traced by a Vite maintainer to Rolldown's `oxcResolvePlugin`, which the dependency optimizer routes package resolution through and which didn't correctly handle PnP resolution in this path.

Solution

typescript
Root cause tracked and fixed upstream at rolldown/rolldown#9302, closed in Rolldown 1.0.2. Vite 8.0.14 bundles Rolldown 1.0.2, so upgrading to vite@8.0.14 or later resolves it - confirmed by Vite maintainer sapphi-red. Earlier attempts to work around it (e.g. testing against rolldown v1.0.0 directly) did not fix the issue; the fix requires the 1.0.2 resolver update specifically.