fix: widen oxlint version range to prevent duplicate vitest instances in pnpm monorepos#702
Draft
NisargIO wants to merge 1 commit into
Draft
fix: widen oxlint version range to prevent duplicate vitest instances in pnpm monorepos#702NisargIO wants to merge 1 commit into
NisargIO wants to merge 1 commit into
Conversation
…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>
commit: |
Contributor
|
No React Doctor issues found. 🎉 Reviewed by React Doctor for commit |
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
Fixes #692 - Installing
react-doctorin a pnpm monorepo withvite-pluscauses duplicate Vitest instances and breaks test collection.Root Cause
When
react-doctor(withoxlint@^1.66.0) was installed alongsidevite-plus(which pinsoxlint@=1.63.0), pnpm created two instances of oxlint with different peer dependency fingerprints:This caused
@voidzero-dev/vite-plus-test(the Vitest fork) to also have two instances with different peer contexts (peer#3672vspeer#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.0to>=1.60.0. This allows pnpm to dedupe the oxlint dependency when the consumer's workspace already provides a compatible version (like vite-plus's1.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
Changes
packages/react-doctor/package.json:oxlint^1.66.0→>=1.60.0packages/core/package.json:oxlint^1.66.0→>=1.60.0package.json(root overrides):oxlint^1.66.0→>=1.60.0