Skip to content

Intermittent "Vitest failed to find the runner" — every test file fails at suite scale on Windows (4.1.10 much more frequent than 4.1.9) #10812

Description

@ronic009

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions