chore(testing): pin vite resolution on yarn for vite 7 downgrade#35586
Open
leosvelperez wants to merge 1 commit intomasterfrom
Open
chore(testing): pin vite resolution on yarn for vite 7 downgrade#35586leosvelperez wants to merge 1 commit intomasterfrom
leosvelperez wants to merge 1 commit intomasterfrom
Conversation
The cypress-legacy and vite e2e tests downgrade vite + plugin-react
in package.json then run install. On yarn classic this trips a
linker bug ("Invariant Violation: could not find a copy of vite to
link in node_modules/vitest/node_modules") because vitest declares
vite as both a regular dependency and a peerDependency, and yarn
1's hoisting algorithm fails when intersecting a top-level
`^7.0.0` range with vitest's vite range.
Add a yarn-specific `resolutions` entry pinning vite so yarn
commits to a single version up front and skips the buggy code
path. npm/pnpm don't have the bug and ignore the field.
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit 7064d8e
☁️ Nx Cloud last updated this comment at |
jaysoo
approved these changes
May 6, 2026
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.
Current Behavior
The
cypress-legacyandvitee2e tests downgradevite+@vitejs/plugin-reactinpackage.jsonand then runinstallto verify backward compatibility with Vite 7. On yarn classic this trips a linker bug:Root cause:
vitest@~4.1.0declaresviteas both a regulardependencyAND apeerDependency. yarn 1's hoisting algorithm fails when intersecting a top-level^7.0.0range with that combo (the bug does not fire for^8.0.0, exact versions, or differently-formatted ranges like7.x). It is not specific to the in-test downgrade — the same setup fails from a completely empty directory.Linux/yarn/20 e2e-cypressandLinux/yarn/20 e2e-vitehave been failing every nightly since the in-test Vite 7 downgrade was introduced in #34850.Expected Behavior
The
cypress-legacyandvitee2e tests pass on yarn classic again with Vite 7.The fix adds a yarn-only
resolutionsentry pinningviteso yarn commits to a single version up front and skips the buggy hoisting code path. npm/pnpm don't have the bug and ignore the field.Validation
Verified via a manually-dispatched e2e nightly run on this branch (with the matrix temporarily narrowed to
Linux/yarn/20 × {e2e-cypress, e2e-vite}, the matrices that fail on master): https://github.com/nrwl/nx/actions/runs/25431401390 — both jobs passed.