-
Notifications
You must be signed in to change notification settings - Fork 940
fix: add react-compiler-runtime for React 18 support #4784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add target: '18' to babel-plugin-react-compiler config - Add [email protected] as dependency to all packages - Fixes 'Cannot find module react/compiler-runtime' error for React 18 users
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 045a128 The changes in this PR will be included in the next version bump. This PR includes changesets to release 47 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Claude encountered an error —— View job Creating changesets for React Compiler Runtime support
|
|
Fixes #4783 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Summary
target: '18'to babel-plugin-react-compiler config in tsdown.config.ts[email protected]as dependency to all 46 packages with React peer dependencyProblem
When using Plate.js >52.0.1 with React 18, users get:
This happens because:
react/compiler-runtime(React 19 built-in)react-compiler-runtimepolyfill package wasn't includedSolution
Per React Compiler docs:
target: '18'to emit imports fromreact-compiler-runtimeinstead ofreact/compiler-runtimereact-compiler-runtimeas a dependency so it ships with the libraryThis works for both React 18 and React 19 users - the polyfill delegates to built-in APIs on React 19.
Test plan
🤖 Generated with Claude Code