Skip to content

fix: add react/react-dom overrides to prevent version mismatch#3031

Merged
joaopcm merged 1 commit intocanaryfrom
fix/react-version-override
Mar 9, 2026
Merged

fix: add react/react-dom overrides to prevent version mismatch#3031
joaopcm merged 1 commit intocanaryfrom
fix/react-version-override

Conversation

@joaopcm
Copy link
Copy Markdown
Member

@joaopcm joaopcm commented Mar 9, 2026

Summary

  • Adds "react": "19.0.0" and "react-dom": "19.0.0" to pnpm.overrides in root package.json
  • The migration to pnpm catalogs (feat: pnpm catalogs #3014) removed these overrides, but catalogs only apply when packages use catalog: specifiers — they don't govern auto-installed peer deps
  • Packages with wide peer dep ranges (e.g. ^18.0 || ^19.0) were resolving react@19.2.3 instead of 19.0.0, causing Incompatible React versions errors at runtime

What broke

Error: Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
  - react:      19.2.3
  - react-dom:  19.0.0

This affected all test suites using @testing-library/react in workspaces with wide react peer dep ranges.


Summary by cubic

Pin react and react-dom to 19.0.0 via root pnpm.overrides to keep versions in sync across workspaces. This prevents runtime “Incompatible React versions” caused by auto-installed peer deps resolving react@19.2.3.

  • Bug Fixes
    • Add react: 19.0.0 and react-dom: 19.0.0 to root package.json pnpm.overrides; update pnpm-lock.yaml.
    • Force packages with wide peer ranges to resolve exactly 19.0.0 for both.
    • Stop relying on catalogs for peers, since catalog: doesn’t affect auto-installed peer deps.

Written for commit bbe1e42. Summary will update on new commits.

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.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 9, 2026

⚠️ No Changeset found

Latest commit: bbe1e42

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-email Ready Ready Preview, Comment Mar 9, 2026 8:01pm
react-email-demo Ready Ready Preview, Comment Mar 9, 2026 8:01pm

Request Review

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@joaopcm joaopcm merged commit 2365781 into canary Mar 9, 2026
18 of 19 checks passed
@joaopcm joaopcm deleted the fix/react-version-override branch March 9, 2026 20:12
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.

2 participants