fix: make oxlint an optional peer dependency to avoid pnpm vitest duplication#701
Draft
NisargIO wants to merge 1 commit into
Draft
fix: make oxlint an optional peer dependency to avoid pnpm vitest duplication#701NisargIO wants to merge 1 commit into
NisargIO wants to merge 1 commit into
Conversation
…lication - Move oxlint from dependencies to peerDependencies in @react-doctor/core and react-doctor - Add peerDependenciesMeta to mark oxlint as optional - Add OxlintNotInstalledError with helpful installation instructions - Add troubleshooting documentation for pnpm monorepo users This fixes an issue where installing react-doctor in pnpm monorepos using vite-plus/vitest causes duplicate Vitest module instances, resulting in "Vitest failed to find the current suite" errors. Closes #[issue-number] 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
This PR addresses the issue where installing
react-doctoras a workspace devDependency in pnpm monorepos using vite-plus/vitest causes duplicate Vitest module instances.Root Cause
When
react-doctoris installed, its dependency onoxlintintroduces a different peer-dependency fingerprint. pnpm creates multiple physical installations of the same Vitest fork when peer contexts differ, causing Vitest's hook registry to split between instances. This results in:Changes
Move
oxlintto optional peer dependency (peerDependencieswithpeerDependenciesMeta.optional: true) in both@react-doctor/coreandreact-doctorAdd
OxlintNotInstalledErrorwith clear installation instructions:Add troubleshooting documentation in README with workarounds:
pnpm dlx react-doctor@latest(recommended for monorepos)oxlintat workspace root separatelyTesting
Migration for Users
Users who install
react-doctorwill now need to also installoxlint:npm install -D react-doctor oxlint # or: pnpm add -D react-doctor oxlintFor users running via
npx/pnpm dlx, no changes are needed as the temporary installation handles dependencies.