You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[email protected] pins [email protected] while its optional peer @vitest/browser-playwright resolves to a newer 4.1.11, causing an unresolvable ERESOLVE on fresh install #2531
[email protected] depends on [email protected] (exact) and peer-depends on @vitest/browser-playwright: "4.1.10" (exact). @vitest/[email protected] — the latest published version on the registry, and the version npm's resolver reaches for when nothing else in the tree pins it — itself peer-requires [email protected] (exact). Because nothing else in a typical consumer's tree pins @vitest/browser-playwright or vitest to a specific version, npm's resolver ends up needing vitest to simultaneously satisfy two mutually exclusive exact-version peer requirements and fails with ERESOLVE.
Environment
vite-plus: 0.2.9
npm: 12.0.2
Node: v26.5.0
Steps to reproduce
In a fresh project with "vite-plus": "^0.2.9" as the only relevant devDependency (no direct vitest or @vitest/browser-playwright pin), run:
rm -rf node_modules package-lock.json
npm install
Observe:
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: <pkg>@undefined
npm error Found: [email protected]
npm error node_modules/vite-plus
npm error dev vite-plus@"^0.2.9" from the root project
npm error peerOptional vite-plus@"*" from [email protected]
npm error node_modules/oxfmt
npm error oxfmt@"=0.61.0" from [email protected]
npm error 2 more (oxlint, @askrjs/vite)
npm error
npm error Could not resolve dependency:
npm error dev vite-plus@"^0.2.9" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/vitest
npm error peer vitest@"4.1.11" from @vitest/[email protected]
npm error node_modules/@vitest/browser-playwright
npm error peerOptional @vitest/browser-playwright@"4.1.11" from [email protected]
and npm view @vitest/browser-playwright versions confirms 4.1.11 is published and is the version npm's resolver prefers absent an explicit pin.
Expected
npm install with no other version pins in the consuming project resolves cleanly against [email protected]'s stated dependency/peer graph.
Actual
npm install fails outright with ERESOLVE; the only workarounds are --legacy-peer-deps/--force (accepting an unverified resolution) or the consumer adding an overrides entry pinning @vitest/browser-playwright to 4.1.10 themselves.
Requirements
vite-plus's own peerDependencies range for @vitest/browser-playwright (and any other split peer like it) is wide enough to include whatever versions of that peer are compatible, OR vite-plus pins/bundles a consistent, mutually-resolvable set itself so a bare npm install doesn't require the consumer to intervene.
Acceptance criteria
rm -rf node_modules package-lock.json && npm install succeeds with no --force/--legacy-peer-deps flag and no consumer-added overrides, on a project whose only relevant devDependency is "vite-plus": "^0.2.9" (or whatever the fixed version is).
I could not reproduce the bare-install failure. Measured on npm 12.0.2 (the version named in the report) and Node v22.22.3 on Linux, each cell a fresh empty directory with its own npm cache:
devDependencies
result
"vite-plus": "^0.2.9"
exit 0 — [email protected]; @vitest/browser-playwright not installed at all
[email protected] lists @vitest/browser-playwright in peerDependenciesMeta as optional: true, so a bare npm install does not pull it into the tree and there is nothing to conflict with.
The report states that 4.1.11 is "the version npm's resolver reaches for when nothing else in the tree pins it". In the second row nothing in the root pins it, but [email protected] declares @vitest/browser-playwright@"4.1.10" as a peer, and npm 12.0.2 installs 4.1.10 rather than latest. The ERESOLVE appears in the third row, where the explicit 4.1.11 pin forces [email protected] into the tree against [email protected]'s own [email protected].
I also noticed that the error output in the report contains oxfmt@"=0.61.0" from [email protected]. The registry shows =0.61.0 is the oxfmt pin of [email protected], while 0.2.9 uses =0.62.0, which suggests the tree that produced the error had 0.2.8 in it.
Not covered by this: Node 26.5.0 (I ran Node 22.22.3), any .npmrc settings including legacy-peer-deps, the other root dependencies visible in the error output (oxfmt, oxlint, @askrjs/vite), a private registry mirror, and Windows.
Activity
fengmk2 commentedon Aug 23, 2026
I can't reproduce this issue according to your reproduction description. Could you provide me with a minimal reproduce repo?
github-actions commentedon Aug 23, 2026
Hello @smiggleworth 👋
Please provide a minimal reproduction using a GitHub repository. This helps us understand and resolve your issue much faster.
A good reproduction should be:
If no reproduction is provided, issues labeled
needs reproductionwill be closed after 3 days of inactivity.For more context on why this is required, please read: https://antfu.me/posts/why-reproductions-are-required
peppe1337 commentedon Aug 26, 2026
I could not reproduce the bare-install failure. Measured on npm 12.0.2 (the version named in the report) and Node v22.22.3 on Linux, each cell a fresh empty directory with its own npm cache:
"vite-plus": "^0.2.9"[email protected];@vitest/browser-playwrightnot installed at all"@vitest/browser-playwright": "*"@vitest/[email protected]installed"@vitest/browser-playwright": "4.1.11"ERESOLVE[email protected]lists@vitest/browser-playwrightinpeerDependenciesMetaasoptional: true, so a barenpm installdoes not pull it into the tree and there is nothing to conflict with.The report states that 4.1.11 is "the version npm's resolver reaches for when nothing else in the tree pins it". In the second row nothing in the root pins it, but
[email protected]declares@vitest/browser-playwright@"4.1.10"as a peer, and npm 12.0.2 installs 4.1.10 rather thanlatest. TheERESOLVEappears in the third row, where the explicit 4.1.11 pin forces[email protected]into the tree against[email protected]'s own[email protected].I also noticed that the error output in the report contains
oxfmt@"=0.61.0" from [email protected]. The registry shows=0.61.0is theoxfmtpin of[email protected], while0.2.9uses=0.62.0, which suggests the tree that produced the error had 0.2.8 in it.Not covered by this: Node 26.5.0 (I ran Node 22.22.3), any
.npmrcsettings includinglegacy-peer-deps, the other root dependencies visible in the error output (oxfmt,oxlint,@askrjs/vite), a private registry mirror, and Windows.chore(deps): update rust crates (#1780)