Skip to content

vite-plus@0.2.9 pins vitest@4.1.10 while its optional peer @vitest/browser-playwright resolves to a newer 4.1.11, causing an unresolvable ERESOLVE on fresh install #2531

Description

@smiggleworth

Summary

vite-plus@0.2.9 depends on vitest@4.1.10 (exact) and peer-depends on @vitest/browser-playwright: "4.1.10" (exact). @vitest/browser-playwright@4.1.11 — 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 vitest@4.1.11 (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

  1. 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
    
  2. Observe:
    npm error code ERESOLVE
    npm error ERESOLVE could not resolve
    npm error
    npm error While resolving: <pkg>@undefined
    npm error Found: vite-plus@0.2.8
    npm error node_modules/vite-plus
    npm error   dev vite-plus@"^0.2.9" from the root project
    npm error   peerOptional vite-plus@"*" from oxfmt@0.61.0
    npm error   node_modules/oxfmt
    npm error     oxfmt@"=0.61.0" from vite-plus@0.2.8
    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: vitest@4.1.11
    npm error node_modules/vitest
    npm error   peer vitest@"4.1.11" from @vitest/browser-playwright@4.1.11
    npm error   node_modules/@vitest/browser-playwright
    npm error     peerOptional @vitest/browser-playwright@"4.1.11" from vitest@4.1.11
    

Confirmed via npm view vite-plus@0.2.9 dependencies:

dependencies = {
  ...
  vitest: '4.1.10',
  ...
}
peerDependencies = {
  '@vitest/browser-playwright': '4.1.10',
  '@vitest/browser-webdriverio': '4.1.10'
}

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 vite-plus@0.2.9'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).

Metadata

Metadata

Assignees

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions