Skip to content

fix(browser): remove orphaned Playwright route when same module is mocked via multiple ids [backport to v4]#10474

Merged
sheremet-va merged 1 commit into
vitest-dev:v4from
toxik:backport/v4.1-browser-orphaned-route-rpc-closed
Jun 1, 2026
Merged

fix(browser): remove orphaned Playwright route when same module is mocked via multiple ids [backport to v4]#10474
sheremet-va merged 1 commit into
vitest-dev:v4from
toxik:backport/v4.1-browser-orphaned-route-rpc-closed

Conversation

@toxik

@toxik toxik commented May 28, 2026

Copy link
Copy Markdown

Description

Backport of #10267 (closes #9957) to the v4 release line — currently shipped only on main / v5.0.0-beta.3. Cherry-picked clean from 41db6ce (no conflicts).

Downstream symptom: in vitest --ui / watch mode against a project with vi.mock(...) and the Playwright browser provider, editing any spec triggers a cascade of unrelated specs failing with [vitest] There was an error when mocking a module / [birpc] rpc is closed, cannot call "resolveManualMock". Root cause is the orphaned-route bug fixed in #10267.

Tests

Tests from the original PR were cherry-picked along with the source change:

  • test/browser/fixtures/mocking/src/aaa-dual-id-probe.test.ts
  • test/browser/fixtures/mocking/src/zzz-dual-id-target.test.ts
  • test/browser/fixtures/mocking/src/dual-id/*
  • New assertions in test/browser/specs/mocking.test.ts

Checklist

@toxik toxik force-pushed the backport/v4.1-browser-orphaned-route-rpc-closed branch from ceb9480 to 992de1b Compare May 29, 2026 04:29
@toxik

toxik commented May 29, 2026

Copy link
Copy Markdown
Author

hey @sheremet-va, mind if we port this back to 4.x?
I have an immediate crash when chaging tests after they ran.

looking at the CI failures, it looks like:

  • 5 out of 6 fail when with a broken/missing chromedriver 148 download
  • one real failure that looks pre-existing

@sheremet-va sheremet-va merged commit 675b434 into vitest-dev:v4 Jun 1, 2026
13 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants