Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using 'home' as vite base breaks vitest on linux filesystems #7073

Open
leonheess opened this issue Dec 11, 2024 · 1 comment
Open

Using 'home' as vite base breaks vitest on linux filesystems #7073

leonheess opened this issue Dec 11, 2024 · 1 comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@leonheess
Copy link

leonheess commented Dec 11, 2024

Describe the bug

If you configure vite with

base: 'home',
test: {
  //
},

...

and run "vitest" on any linux file systems, you get the following error:

Error: Failed to load url /projects/vitest-dev-vitest-98qlmqvh/node_modules/vitest/dist/spy.js (resolved id: /projects/vitest-dev-vitest-98qlmqvh/node_modules/vitest/dist/spy.js). Does the file exist?
 ❯ loadAndTransform node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:51969:17
 ❯ ViteNodeServer._transformRequest node_modules/vite-node/dist/server.mjs:561:16
 ❯ ViteNodeServer._fetchModule node_modules/vite-node/dist/server.mjs:523:17
 ❯ Proxy.fetch node_modules/vitest/dist/chunks/resolveConfig.RxKrDli4.js:6647:22
 ❯ EventEmitter.onMessage node_modules/vitest/dist/chunks/index.68735LiX.js:104:20

This bug is not reproducible on macOS or Windows and occurs on both npm and pnpm. Configuring the base as '/home/' or '/home' has the same effect.

Reproduction (StackBlitz uses Linux)

https://stackblitz.com/edit/vitest-dev-vitest-98qlmqvh?file=vite.config.ts

@hi-ogawa hi-ogawa added p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Dec 12, 2024
@hi-ogawa
Copy link
Contributor

It was reported on Vite vitejs/vite#18279 but I couldn't find a reproduction with only Vite, so probably having the issue here makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

2 participants