Skip to content

fix(browser): don't redirect vitest in client environment - #10975

Merged
sheremet-va merged 2 commits into
mainfrom
fix/browser-client-env-resolution
Aug 17, 2026
Merged

fix(browser): don't redirect vitest in client environment#10975
sheremet-va merged 2 commits into
mainfrom
fix/browser-client-env-resolution

Conversation

@sheremet-va

Copy link
Copy Markdown
Member

With inline projects, the vitest:resolve-root plugin redirected vitest imports to the root server, which resolved them to raw dist files, while pre-bundled dependencies got the optimizer's copy of the runtime. The second copy has no runner state, failing any setup file that imports a package like vitest-browser-react. Both resolvers now stay out of the browser client environment, so everything resolves to the pre-bundled copy.

Also moves @vitest/browser/client from optimizeDeps.include to exclude: it is not resolvable from the project root under pnpm (see the Failed to resolve dependency warning in #10836), and the built file is self-contained, so pre-bundling it buys nothing.

Closes #10944

@netlify

netlify Bot commented Aug 17, 2026

Copy link
Copy Markdown

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 64b2c43
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6a83053fa32f1b00087d2da1
😎 Deploy Preview https://deploy-preview-10975--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sheremet-va

Copy link
Copy Markdown
Member Author

I'm gonna merge the fix to test it out in a new rc, the review is still welcome if anything is wrong

@sheremet-va
sheremet-va merged commit aeb6720 into main Aug 17, 2026
29 of 30 checks passed
@sheremet-va
sheremet-va deleted the fix/browser-client-env-resolution branch August 17, 2026 13:10
@silvenon

Copy link
Copy Markdown
Contributor

That worked, thank you very much ❤️

@github-actions github-actions Bot locked and limited conversation to collaborators Sep 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Vitest failed to find the runner" in Browser Mode since v5.0.0-beta.7, including rc.1

2 participants