Skip to content

@remotion/transitions: Mark react-dom as external in the ESM build - #12187

Closed
thibserot wants to merge 1 commit into
remotion-dev:mainfrom
thibserot:transitions-external-react-dom
Closed

thibserot wants to merge 1 commit into
remotion-dev:mainfrom
thibserot:transitions-external-react-dom

Conversation

@thibserot

Copy link
Copy Markdown

Fixes #12186.

Since 4.0.531, TransitionSeries.tsx imports createPortal from react-dom (#11841). packages/transitions/bundle.ts didn't list react-dom as external, so Bun inlined the monorepo's react-dom 19.2.3 into dist/esm/index.mjs. In a React 18 project, bundling then fails with export '__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE' … was not found in 'react'. This adds 'react-dom' to external, as @remotion/media, @remotion/studio and remotion already do. react-dom is already a peer dependency of @remotion/transitions.

Verified by running NODE_ENV=production bun bundle.ts (Bun 1.3.3) in packages/transitions:

  • Before: Bun has to resolve react-dom in order to inline it (Could not resolve: "react-dom" in a checkout without dependencies).
  • After: the build succeeds with 21 entry files. dist/esm/index.mjs contains import { createPortal } from "react-dom"; and no __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.

The same change, applied as a patch to the published 4.0.534 ESM build, bundles and renders a React 18.3.1 project again.

Trade-offs: none that I can see. The CJS build already did require("react-dom"), so ESM and CJS now resolve the same react-dom, the user's own.

TransitionSeries imports createPortal from react-dom since 4.0.531, and
without the external Bun inlined react-dom 19.2.3 into dist/esm, which
fails to bundle on React 18.

Fixes remotion-dev#12186

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
bugs Ready Ready Preview Oct 11, 2026 3:25am UTC
remotion Ready Ready Preview Oct 11, 2026 3:25am UTC

Request Review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

  • Mark react-dom external in the ESM build — adds 'react-dom' to the external list in packages/transitions/bundle.ts:43, so TransitionSeries.tsx's createPortal import is no longer inlined from the monorepo's React 19 install.

The change is correct and matches the established convention: core, media, studio, design, shapes, and nearly every other package already list react-dom as external. react-dom is already declared as a peerDependency (>=16.8.0), and the CJS build already emitted require('react-dom'), so ESM and CJS now resolve the user's own react-dom consistently. Only react-dom is imported from package source (TransitionSeries.tsx:3); the react-dom/client and react-dom/server imports live in src/test/, which is not a bundle entrypoint, so no additional external entry is needed.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash | 𝕏

@thibserot

thibserot commented Oct 11, 2026 •

Copy link
Copy Markdown
Author

The one failing check, e2e/captions-inspector.test.mts:60 ("persists caption edits at their inline definitions"), fails the same way on unrelated PRs, documentation-only ones included: #12185, #12182 and #12184. It doesn't look related to this change, which only touches packages/transitions/bundle.ts.

@thibserot

Copy link
Copy Markdown
Author

Superseded by #12193, which landed the same change. Thanks for the quick fix!

@thibserot thibserot closed this Oct 11, 2026

This branch was successfully deployed

2 active deployments
Preview – remotion — 01b1f40b Deployed Oct 11, 2026 by vercel[bot]
Preview – bugs — 01b1f40b Deployed Oct 11, 2026 by vercel[bot]
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.

@remotion/transitions: ESM build inlines react-dom 19 since 4.0.531, breaking React 18 projects

1 participant