You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛 BUG: vitest-plugin fails every test file under vitest 5's default fsModuleCache (readAll: no such file or directory) #16237
Vitest 5 turns fsModuleCache on by default, caching transformed modules under node_modules/.vitest-cache. With @cloudflare/vitest-plugin, every test file fails before any test runs: the runner inside workerd tries to read a cache entry and gets "no such file or directory". The file does exist on disk afterwards. The error is the same on every rerun, including when the cache directory is already populated.
Expected: the test runs and passes, as it does with vitest 4.
Actual:Tests no tests, 1 unhandled error, exit code 1.
Workaround: set test: { fsModuleCache: false } in the config. The test then passes.
Please provide any relevant error logs
Error: no such file or directory, readAll '<project>/node_modules/.vitest-cache/9de5a8914086735fda8600864a1f6ba45fb9da03'
❯ reviveInvokeError node_modules/vite/dist/node/module-runner.js:556:14
❯ Object.invoke node_modules/vite/dist/node/module-runner.js:572:33
❯ maybeHandleRunRequest node_modules/@cloudflare/vitest-plugin/dist/worker/lib/cloudflare/test-internal.mjs:157:18
❯ __VITEST_POOL_WORKERS_RUNNER_DURABLE_OBJECT__.fetch index.mjs:985:20
Bug (high): vitest-plugin 1.4.0 fails every test file under vitest 5.0.4's default fsModuleCache with a readAll ENOENT in the workerd module runner; environment, minimal repro, expected/actual behavior, and error output are all provided, so it is actionable.
Reproduction reason: Complete five-file minimal reproduction with pinned versions and a single run command; ordinary, non-suspicious steps describing a current behavior defect consistent with a real vitest 5 incompatibility.
Reproduction
Result: ✅ Reproduced.
Summary: Reproduced: cloudflare/vitest-plugin 1.4.0 + vitest 5.0.4 (default fsModuleCache): vitest run fails pre-test with 'no such file or directory, readAll node_modules/.vitest-cache/(hash)' from the plugin's in-workerd runner; exit 1, identical on rerun; passes with fsModuleCache:false.
Evidence and attempted steps
Steps attempted:
Create the issue's minimal 5-file fixture (Worker plus one SELF test, wrangler.jsonc, vitest.config.ts) and install exact pinned versions: cloudflare/vitest-plugin 1.4.0, vitest 5.0.4, coverage-v8 5.0.4, wrangler ^4.135.0 (resolved 4.149.0).
Run vitest with the issue's exact config (vitest 5 default fsModuleCache on). Observed the reported readAll error, 'Tests: no tests', exit code 1.
Command: npx vitest run
Verify the issue's claim that the 'missing' cache file exists on disk after the run.
Command: ls -l node_modules/.vitest-cache/
Rerun with the cache directory already populated; observed the identical error and hash, exit code 1, as the issue reports for every rerun.
Command: npx vitest run
Single baseline run using the issue's workaround (test.fsModuleCache: false via vitest.no-cache.config.ts) to rule out a generically broken setup; the test passed.
Command: npx vitest run -c vitest.no-cache.config.ts
Expected behavior: The single test in test/index.test.ts (SELF.fetch against the local Worker via cloudflare:test) runs and passes under vitest 5.0.4 with cloudflare/vitest-plugin 1.4.0, as it does with vitest 4 and as it does when test.fsModuleCache is set to false (the issue's documented workaround).
Observed behavior: npx vitest run fails before running any test: the suite fails with Error: no such file or directory, readAll '/workspace/work/repro/node_modules/.vitest-cache/e0a19d69fbea3c602e7f8b33ce9785afd1cf2ad3'; stack: maybeHandleRunRequest at cloudflare/vitest-plugin dist/worker/lib/cloudflare/test-internal.mjs:157:18, then the plugin's runner Durable Object fetch at index.mjs:985:20. Summary: Test Files 1 failed (1), Tests: no tests, exit code 1. The named cache file exists on disk afterwards (1964 bytes). A rerun with the cache directory already populated fails identically with the same hash. With test.fsModuleCache:false the same test passes (1 passed, exit code 0).
Closing as a duplicate: this is the fsModuleCache report on #16132, and #16163 fixes it by reading the cache files in the Node pool before forwarding them to workerd. Sorry for the noise. I searched issues but not PRs.
Activity
workers-devprod commentedon Oct 13, 2026
Automated triage
Issue assessment
bug(high)package:vitest(high)regression(medium)Actionability and missing information
Bug (high): vitest-plugin 1.4.0 fails every test file under vitest 5.0.4's default fsModuleCache with a readAll ENOENT in the workerd module runner; environment, minimal repro, expected/actual behavior, and error output are all provided, so it is actionable.
Reproduction reason: Complete five-file minimal reproduction with pinned versions and a single run command; ordinary, non-suspicious steps describing a current behavior defect consistent with a real vitest 5 incompatibility.
Reproduction
Evidence and attempted steps
Steps attempted:
pnpm install && pnpm rebuild esbuild workerdnpx vitest runls -l node_modules/.vitest-cache/npx vitest runnpx vitest run -c vitest.no-cache.config.tsExpected behavior: The single test in test/index.test.ts (SELF.fetch against the local Worker via cloudflare:test) runs and passes under vitest 5.0.4 with cloudflare/vitest-plugin 1.4.0, as it does with vitest 4 and as it does when test.fsModuleCache is set to false (the issue's documented workaround).
Observed behavior: npx vitest run fails before running any test: the suite fails with Error: no such file or directory, readAll '/workspace/work/repro/node_modules/.vitest-cache/e0a19d69fbea3c602e7f8b33ce9785afd1cf2ad3'; stack: maybeHandleRunRequest at cloudflare/vitest-plugin dist/worker/lib/cloudflare/test-internal.mjs:157:18, then the plugin's runner Durable Object fetch at index.mjs:985:20. Summary: Test Files 1 failed (1), Tests: no tests, exit code 1. The named cache file exists on disk afterwards (1964 bytes). A rerun with the cache directory already populated fails identically with the same hash. With test.fsModuleCache:false the same test passes (1 passed, exit code 0).
Artifact: Download reproduction archive (Cloudflare Access required).
This summary was generated by an LLM and may contain errors. Please verify its findings.
Triage bot commands and options
Repository collaborators with write or admin access can trigger actions by commenting on this issue:
@workers-devprod reproduce: Attempt to reproduce the issue using its description and recent comments.colby-makowsky commentedon Oct 13, 2026
Closing as a duplicate: this is the fsModuleCache report on #16132, and #16163 fixes it by reading the cache files in the Node pool before forwarding them to workerd. Sorry for the noise. I searched issues but not PRs.
Prune leftover vitest 4 packages from bun.lock (#718)
chore(deps): bump dependencies and disable worker fsModuleCache (#175)
chore(deps): update dependencies with npm-check-updates (#75)
chore(deps): update dependencies with npm-check-updates (#45)
Merge main: adopt vitest 5.0.5 + @cloudflare/vitest-plugin 1.4.3 with…
Merge origin/main into dependabot branch
chore(deps-dev): vitest 5.0.4 と @cloudflare/vitest-plugin 1.4.4 に上げる (#…