Repository navigation
chore(deps): hold msw at 2.x on the @vitest/mocker peer range - #428
Merged
Merged
Conversation
msw 3 cannot be installed here, and the error does not say so. Every job on #424 died at `npm ci` with EUSAGE "Missing: msw@2.15.0 from lock file", which reads like a stale lockfile and is not one: the branch lockfile resolves msw@3.0.2 and nothing anywhere declares 2.15.0. The cause is an optional peer dependency we do not own. @vitest/mocker, pulled in by vitest and still at 5.0.3 (latest), declares an optional peer `msw: ^2.4.9`. msw 3 does not satisfy it, so npm nests an msw@2.15.0 beside the mocker - a tree Dependabot's lockfile does not describe. It reproduces only on CI's npm. `npm ci --dry-run` on the exact merge commit CI rejected succeeds under npm 11.11.0 and fails under npx npm@10.9.4, which is what Node 22.23.3 bundles in CI. A second independent blocker sits behind the first: msw 3 moved its entry points, so `from 'msw'` becomes `from 'msw/http'` and `onUnhandledRequest` becomes `onUnhandledFrame` across the four tests/fixtures/msw servers and the ~12 specs that start them. A version-only bump can never be green. Records both in .github/dependabot.yml and runbook section 5, with a named exit criterion: @vitest/mocker widening its msw peer range. Closes #424 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c372e6ba-4c3f-419a-9f77-b9e23adfc874
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.
Summary
msw 3 cannot be installed in this repo, and the error does not say so.
Every one of the twelve jobs on #424 died inside 15 seconds at
npm ci:⚠ That reads like a stale lockfile and is not one. It survived two
@dependabot rebaserounds, arerun --failed, and a close/reopen. Thelockfile on that branch is correct:
node_modules/mswresolves3.0.2, theroot manifest declares
"msw": "3.0.2", and no manifest or lock entryanywhere mentions
2.15.0.The cause is an optional peer dependency we do not own.
@vitest/mocker—pulled in by
vitest, and still at5.0.3, the latest published version —declares:
msw@3.0.2does not satisfy^2.4.9, so npm wants to nest anmsw@2.15.0beside the mocker. Dependabot's lockfile has no such nested entry, so the tree
npm computes and the tree the lockfile describes disagree →
EUSAGE.⚠ It only reproduces on CI's npm, which is the trap.
npm ci --dry-runonthe exact merge commit CI rejected (
2bed305) succeeds under localnpm 11.11.0, and fails with the identical error under
npx npm@10.9.4— whichis what Node 22.23.3 bundles in CI. "It installs fine locally" proves nothing
here.
A second, independent blocker sits behind the first. msw 3 moved its entry
points, so even once the peer range is fixed this is a migration, not a bump:
import { http, HttpResponse, passthrough } from 'msw'becomes'msw/http',and
onUnhandledRequestbecomesonUnhandledFrame. That touches the fourfixture servers in
tests/fixtures/msw/*and the ~12 specs that start them. Aversion-only Dependabot PR can never be green on its own.
This PR records both findings with a named exit criterion, in the same shape as
the jsdom hold that landed in #426.
Linked issue / task
Closes #424.
Type of change
infra/**) —.github/dependabot.ymlTesting done
Documentation and Dependabot configuration only; no acceptance criterion
changes, so no AC → test mapping applies (
specs/testing.md§10).Gates run locally on this branch:
npm run format:checkpython -c "import yaml; ..."(parse.github/dependabot.yml)msw >=3among themEvidence gathered while diagnosing (not gates):
npm ci --dry-runon2bed305under npm 11.11.0npx -y npm@10.9.4 ci --dry-runon2bed305EUSAGE … Missing: msw@2.15.0— reproduces CI exactlynpm view "@vitest/mocker@latest" peerDependencies{ msw: '^2.4.9', vite: '^6.0.0 || ^7.0.0 || ^8.0.0' }T-INFRA-018dreads onlypackage.json,.nvmrcandDockerfile, so a newdependabot.ymlignore entry does not affect it.Checklist
T-MIG-001). — no migrations.