Skip to content

Vitest Assets are not accessible when run with projects #9007

@herrlegno

Description

@herrlegno

Describe the bug

Vitest screenshots assets are not being exposed correctly, and vitest ui is not able to reach them.

When using projects config to run browser tests, vitest ui shows a broken ref image.

Current Behavior:

Image

Expected Behavior:

Image

Reproduction

I've created a minimal reproduction repo:

In this repo in the vitest.config.ts you will see 2 configs:

  • The default (uncommented) is the one that fails (current behavior)
  • The commented is the one used for expected behavior

Steps:

  • download the project to be able to use playwright, as stackblitz does not allow it
  • npm ci
  • run npm run test
    • remember to delete reference screenshots between runs or the tests will not fail

System Info

System:
    OS: macOS 15.6.1
    CPU: (8) arm64 Apple M3
    Memory: 334.80 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.11.0 - /[REDACTED]/.nvm/versions/node/v24.11.0/bin/node
    npm: 11.6.1 - /[REDACTED]/.nvm/versions/node/v24.11.0/bin/npm
  Browsers:
    Brave Browser: 141.1.83.120
    Safari: 18.6

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: browserIssues and PRs related to the browser runnerfeat: uiVitest UIp3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions