Skip to content

[Vite 8] Fails to resolve modules to non-system drive path for Yarn PnP global cache folder #21875

Description

@psychobolt

Describe the bug

Use case issue ran against my Windows environment with project/workspace on a non-system (or external) drive.

  1. Fails when setting global folder to a /non/system/drive/path
  2. Success when setting global folder to a /local/workspace/path
  3. Success when setting global folder to a /system/drive/path

Case 1 was working for Vite 7.

I also created related issue: rolldown/rolldown#8699

Reproduction

https://github.com/psychobolt/svelte-yarn-pnp

Steps to reproduce

  1. Follow the README setup instructions
  2. yarn dev

System Info

System:
    OS: Windows 11 10.0.26200
    CPU: (16) x64 AMD Ryzen 7 9800X3D 8-Core Processor
    Memory: 13.69 GB / 31.08 GB
  Binaries:
    Node: 22.22.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 4.12.0 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.9.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 145.0.7632.160
    Edge: Chromium (140.0.3485.54)
    Firefox: 146.0.1 - C:\Program Files\Mozilla Firefox\firefox.exe
    Internet Explorer: 11.0.26100.7309

Used Package Manager

yarn

Logs

Click to expand!
yarn dev                        

  VITE v8.0.0  ready in 1263 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
3:13:49 PM [vite] (ssr) Error when evaluating SSR module /@fs/D:/psychobolt-github/svelte-yarn-pnp/.yarn/__virtual__/@sveltejs-kit-virtual-041069e129/3/.yarn/berry/cache/@sveltejs-kit-npm-2.55.0-5ae421601a-10c0.zip/node_modules/@sveltejs/kit/src/runtime/server/index.js: Failed to load url ../../utils/promise.js (resolved id: ../../utils/promise.js) in D:/psychobolt-github/svelte-yarn-pnp/.yarn/__virtual__/@sveltejs-kit-virtual-041069e129/3/.yarn/berry/cache/@sveltejs-kit-npm-2.55.0-5ae421601a-10c0.zip/node_modules/@sveltejs/kit/src/runtime/server/index.js. Does the file exist?
      at loadAndTransform (file:///D:/psychobolt-github/svelte-yarn-pnp/.yarn/__virtual__/vite-virtual-8dc263fac4/3/.yarn/berry/cache/vite-npm-8.0.0-259ca3eb1b-10c0.zip/node_modules/vite/dist/node/chunks/node.js:24122:31)

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: upstreamBug in a dependency of Viteclarity: highp2-edge-caseBug, but has workaround or limited in scope (priority)

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions