Describe the bug
At full-suite scale (207 test files / ~4,000 tests), entire runs intermittently fail with every single file erroring at collection:
Error: Vitest failed to find the runner. One of the following is possible:
- "vitest" is imported directly without running "vitest" command
...
(or the variant TypeError: Cannot read properties of undefined (reading 'config') at the first describe()). Summary shows Test Files 207 failed (207) / Tests: no tests / import 0ms — no test ever executes. Small runs (1–4 files) pass consistently.
Frequency matrix observed (same machine, same tree, ~1 hour window)
vitest 4.1.10: 3 of 4 full-suite runs failed entirely (the 4th passed 206/207 with 1 file erroring). One 4-file run also failed the same way.
vitest 4.1.9 (only change: npm i vitest@4.1.9): 7+ runs, exactly one failure — the first run immediately after npm install; the identical command re-run seconds later passed, and kept passing. This project ran 4.1.9 green for months before the 4.1.10 bump.
So the failure mode exists on both versions but is dramatically more frequent on 4.1.10 (suite-scale runs mostly fail) vs 4.1.9 (only observed right after an install).
Possibly related
Reproduction
Private medical repo — cannot share as-is. Plain config: environment: 'node', one setupFiles, no workspace/projects, default pool. Happy to run any diagnostic/verbose flags or a patched build on request.
System Info
OS: Windows 11 Pro 10.0.26100
Node: v24.15.0
vitest: 4.1.10 / 4.1.9 (compared)
vite: 6.4.2
Describe the bug
At full-suite scale (207 test files / ~4,000 tests), entire runs intermittently fail with every single file erroring at collection:
(or the variant
TypeError: Cannot read properties of undefined (reading 'config')at the firstdescribe()). Summary showsTest Files 207 failed (207) / Tests: no tests / import 0ms— no test ever executes. Small runs (1–4 files) pass consistently.Frequency matrix observed (same machine, same tree, ~1 hour window)
vitest 4.1.10: 3 of 4 full-suite runs failed entirely (the 4th passed 206/207 with 1 file erroring). One 4-file run also failed the same way.
vitest 4.1.9 (only change:
npm i vitest@4.1.9): 7+ runs, exactly one failure — the first run immediately afternpm install; the identical command re-run seconds later passed, and kept passing. This project ran 4.1.9 green for months before the 4.1.10 bump.So the failure mode exists on both versions but is dramatically more frequent on 4.1.10 (suite-scale runs mostly fail) vs 4.1.9 (only observed right after an install).
Possibly related
@angular/build:unit-test(vitest): every test fails with "Vitest failed to find the runner" on Windows when the cwd drive-letter casing differs from the on-disk casing angular/angular-cli#33559 reports the same error text on Windows, deterministic whenprocess.cwd()has a lowercase drive letter (c:\...vs canonicalC:\...), env shows 4.1.10. We could not force a lowercase-cwd repro in our environment (our shells normalize toC:), so we cannot confirm the casing link — but the error text and all-files blast radius match exactly.Reproduction
Private medical repo — cannot share as-is. Plain config:
environment: 'node', onesetupFiles, no workspace/projects, default pool. Happy to run any diagnostic/verbose flags or a patched build on request.System Info