fix: add react/react-dom overrides to prevent version mismatch#3031
Merged
fix: add react/react-dom overrides to prevent version mismatch#3031
Conversation
The migration to pnpm catalogs removed the react/react-dom overrides, but catalogs don't govern auto-installed peer deps. Packages with wide peer dep ranges (e.g. ^18.0 || ^19.0) resolve react@19.2.3 instead of 19.0.0, causing react/react-dom version mismatch errors at runtime.
|
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
gabrielmfern
approved these changes
Mar 9, 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.
Summary
"react": "19.0.0"and"react-dom": "19.0.0"topnpm.overridesin rootpackage.jsoncatalog:specifiers — they don't govern auto-installed peer deps^18.0 || ^19.0) were resolvingreact@19.2.3instead of19.0.0, causingIncompatible React versionserrors at runtimeWhat broke
This affected all test suites using
@testing-library/reactin workspaces with wide react peer dep ranges.Summary by cubic
Pin
reactandreact-domto 19.0.0 via rootpnpm.overridesto keep versions in sync across workspaces. This prevents runtime “Incompatible React versions” caused by auto-installed peer deps resolvingreact@19.2.3.react: 19.0.0andreact-dom: 19.0.0to rootpackage.jsonpnpm.overrides; updatepnpm-lock.yaml.19.0.0for both.catalog:doesn’t affect auto-installed peer deps.Written for commit bbe1e42. Summary will update on new commits.