Skip to content

fix: widen oxlint version range to prevent duplicate vitest instances in pnpm monorepos#702

Draft
NisargIO wants to merge 1 commit into
mainfrom
cursor/fix-pnpm-vitest-duplicate-instances-bcd0
Draft

fix: widen oxlint version range to prevent duplicate vitest instances in pnpm monorepos#702
NisargIO wants to merge 1 commit into
mainfrom
cursor/fix-pnpm-vitest-duplicate-instances-bcd0

Conversation

@NisargIO

@NisargIO NisargIO commented Jun 6, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #692 - Installing react-doctor in a pnpm monorepo with vite-plus causes duplicate Vitest instances and breaks test collection.

Root Cause

When react-doctor (with oxlint@^1.66.0) was installed alongside vite-plus (which pins oxlint@=1.63.0), pnpm created two instances of oxlint with different peer dependency fingerprints:

oxlint@1.63.0 → vite-plus dependency graph
oxlint@1.68.0 → react-doctor dependency graph

This caused @voidzero-dev/vite-plus-test (the Vitest fork) to also have two instances with different peer contexts (peer#3672 vs peer#4bfa). At test runtime, test files would import hooks from one Vitest instance while the runner used another, breaking Vitest's internal hook registry and causing "Vitest failed to find the current suite" errors.

Solution

Widen the oxlint version range from ^1.66.0 to >=1.60.0. This allows pnpm to dedupe the oxlint dependency when the consumer's workspace already provides a compatible version (like vite-plus's 1.63.0), preventing the cascade of duplicate instances.

The CLI features react-doctor uses (-c, --format json, --tsconfig, --ignore-path) are stable across oxlint 1.60+, so there's no compatibility concern.

Verification

  1. All existing tests pass
  2. Typecheck passes
  3. Lint passes
  4. Format check passes

Changes

  • packages/react-doctor/package.json: oxlint ^1.66.0>=1.60.0
  • packages/core/package.json: oxlint ^1.66.0>=1.60.0
  • package.json (root overrides): oxlint ^1.66.0>=1.60.0
Open in Web Open in Cursor 

…st instances

When react-doctor was installed alongside vite-plus (which pins oxlint@=1.63.0),
pnpm created two instances of oxlint with different peer dependency fingerprints.
This caused the vitest fork (@voidzero-dev/vite-plus-test) to also have two
instances, breaking Vitest's internal hook registry and causing 'Vitest failed
to find the current suite' errors.

By widening the version range from ^1.66.0 to >=1.60.0, pnpm can now dedupe
the oxlint dependency when the consumer's workspace already provides a
compatible version, preventing the cascade of duplicate instances.

The CLI features react-doctor uses (-c, --format json, --tsconfig, --ignore-path)
are stable across oxlint 1.60+.

Fixes #692

Co-authored-by: Nisarg Patel <NisargIO@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Jun 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-react-doctor@702
npm i https://pkg.pr.new/oxlint-plugin-react-doctor@702
npm i https://pkg.pr.new/react-doctor@702

commit: 3ff8cfe

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

No React Doctor issues found. 🎉

Reviewed by React Doctor for commit 3ff8cfe.

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.

[deslop/unused-file] Respect .gitignore

2 participants