-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
vitest fails to start if volume is mounted read-only #4901
Comments
I'm not sure if Vitest (or Vite) is ever intended to run on read-only volume, but this specific error is due to the way Vite loads config file, so I don't think Vitest can do anything about it https://github.com/vitejs/vite/blob/3c9cab6912dc627a22abba4c3fd6074166f5cc4c/packages/vite/src/node/config.ts#L1174 upstream: vitejs/vite#9470 |
Just to add some input from someone who faced and mitigated this issue: My team was looking into moving our Jest integration test package to Vitest, and the internal platform we use executes test runs in AWS Lambda which similarly to other container runtimes also runs a read only filesystem. A workaround is quite simple however, given The rationale is simple from then forward, for both Vite and Vitest:
In regards to symlinking node_modules in specific there are two possible solutions:
IMO changing the cache directory is the cleanest solution as symlinking the whole of node_modules could slow down your test run depending on dependency closure. Thanks to Vitest folks for being diligent about this existing as an upstream issue. It seems Vite has supported loading configs without writing to the filesystem in the past but disabled it due to concerns found on Node 17. I hope we can see those changes introduced again in some form or another. |
Describe the bug
vitest fails to start if volume is mounted read-only
Reproduction
vitest.config.js
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: