fix(browser): remove orphaned Playwright route when same module is mocked via multiple ids [backport to v4]#10474
Merged
sheremet-va merged 1 commit intoJun 1, 2026
Conversation
…cked via multiple ids [backport to v4] backport of vitest-dev#10267 (fixes vitest-dev#9957)
ceb9480 to
992de1b
Compare
Author
|
hey @sheremet-va, mind if we port this back to 4.x? looking at the CI failures, it looks like:
|
sheremet-va
approved these changes
Jun 1, 2026
1 task
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #10267 (closes #9957) to the
v4release line — currently shipped only onmain/v5.0.0-beta.3. Cherry-picked clean from41db6ce(no conflicts).Downstream symptom: in
vitest --ui/ watch mode against a project withvi.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.tstest/browser/fixtures/mocking/src/zzz-dual-id-target.test.tstest/browser/fixtures/mocking/src/dual-id/*test/browser/specs/mocking.test.tsChecklist
pnpm-lock.yamlchanges