Skip to content

Vitest browser mode tests do not run when using projects #9164

@Andrei486

Description

@Andrei486

Describe the bug

I am using a monorepo with multiple subpackages. To manage this, I am using vitest, with a configuration at the project root which defines each package as a project. When I run tests (vitest run) from the project root, the non-browser tests run correctly, but browser tests sometimes do not appear and cause the test run to hang. This problem is inconsistent, and usually happens on the first run or after deleting the .vite folder in node_modules (though it can happen other times as well). With a larger number of tests in a non-minimal case I have noticed that sometimes only a few browser tests will be missing at once.

When running vitest run from any of the packages directly, all tests in that package (even browser tests) are executed correctly without fail.

This seems very similar to #3363 which was supposedly closed.

Reproduction

This repo serves as a minimal reproduction: https://github.com/Andrei486/vitest-project-repro.

System Info

System:
    OS: macOS 14.8.2
    CPU: (16) arm64 Apple M3 Max
    Memory: 13.93 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.19.4 - /opt/homebrew/opt/node@20/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.8.2 - /opt/homebrew/opt/node@20/bin/npm
    pnpm: 9.12.3 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 142.0.7444.176
    Safari: 17.6
  npmPackages:
    @vitest/browser-playwright: latest => 4.0.15 
    vitest: latest => 4.0.15

Used Package Manager

pnpm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions