Skip to content

Conversation

@zbeyens
Copy link
Member

@zbeyens zbeyens commented Dec 12, 2025

Summary

  • Add target: '18' to babel-plugin-react-compiler config in tsdown.config.ts
  • Add [email protected] as dependency to all 46 packages with React peer dependency
  • Fixes "Cannot find module 'react/compiler-runtime'" error for React 18 users

Problem

When using Plate.js >52.0.1 with React 18, users get:

Cannot find module 'react/compiler-runtime'

This happens because:

  1. React Compiler was outputting code that imports from react/compiler-runtime (React 19 built-in)
  2. React 18 doesn't have this module
  3. The react-compiler-runtime polyfill package wasn't included

Solution

Per React Compiler docs:

  • Set target: '18' to emit imports from react-compiler-runtime instead of react/compiler-runtime
  • Add react-compiler-runtime as a dependency so it ships with the library

This works for both React 18 and React 19 users - the polyfill delegates to built-in APIs on React 19.

Test plan

  • Install Plate in a fresh React 18 project
  • Verify no "Cannot find module" error
  • Verify React 19 projects still work

🤖 Generated with Claude Code

- 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
@codesandbox
Copy link

codesandbox bot commented Dec 12, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@vercel
Copy link

vercel bot commented Dec 12, 2025

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

Project Deployment Preview Comments Updated (UTC)
plate Error Error Dec 12, 2025 3:01pm

@changeset-bot
Copy link

changeset-bot bot commented Dec 12, 2025

🦋 Changeset detected

Latest commit: 045a128

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 47 packages
Name Type
@platejs/ai Patch
@platejs/autoformat Patch
@platejs/basic-nodes Patch
@platejs/basic-styles Patch
@platejs/callout Patch
@platejs/caption Patch
@platejs/code-block Patch
@platejs/combobox Patch
@platejs/comment Patch
@platejs/core Patch
@platejs/csv Patch
@platejs/cursor Patch
@platejs/date Patch
@platejs/diff Patch
@platejs/dnd Patch
@platejs/docx Patch
@platejs/emoji Patch
@platejs/excalidraw Patch
@platejs/find-replace Patch
@platejs/floating Patch
@platejs/indent Patch
@platejs/juice Patch
@platejs/layout Patch
@platejs/link Patch
@platejs/list Patch
@platejs/list-classic Patch
@platejs/markdown Patch
@platejs/math Patch
@platejs/media Patch
@platejs/mention Patch
@platejs/playwright Patch
@platejs/resizable Patch
@platejs/selection Patch
@platejs/slash-command Patch
@platejs/suggestion Patch
@platejs/tabbable Patch
@platejs/table Patch
@platejs/tag Patch
@platejs/toc Patch
@platejs/toggle Patch
@platejs/utils Patch
@platejs/yjs Patch
@udecode/cmdk Patch
@udecode/cn Patch
@udecode/react-hotkeys Patch
@udecode/react-utils Patch
platejs Patch

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

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 12, 2025
@claude
Copy link
Contributor

claude bot commented Dec 12, 2025

Claude encountered an error —— View job


Creating changesets for React Compiler Runtime support

I'm creating changesets for the React 18 compatibility fix. This PR adds react-compiler-runtime as a dependency to all packages with React peer dependencies.

Todo List

  • Read changeset guide at .claude/commands/changeset.md
  • Check for existing changesets in .changeset directory
  • Create individual changeset files for each affected package
  • Commit all changeset files to the branch

Progress

No existing changesets found. Now creating individual changeset files for each of the 46 affected packages...

@dosubot dosubot bot added bug Something isn't working dependencies Pull requests that update a dependency file labels Dec 12, 2025
@zbeyens
Copy link
Member Author

zbeyens commented Dec 12, 2025

Fixes #4783

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@zbeyens zbeyens merged commit 67db30b into main Dec 12, 2025
2 of 3 checks passed
@zbeyens zbeyens deleted the fix/react-compiler-runtime branch December 12, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies Pull requests that update a dependency file size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants