fix: share react-dom/client as its own MF module - #83
Merged
Merged
Conversation
React 19's createRoot/hydrateRoot live in this subpath, which Module Federation treats as a distinct shared module from 'react-dom' rather than folding it in automatically. One of this plugin's dependencies imports it (confirmed present in the built remoteEntry.js as its own shared chunk), but it was never declared in `shared`, so MF tried to bridge it against nothing on the host side and crashed with React's own "incompatible react/react-dom versions" invariant (error #527) instead of just using this plugin's own bundled copy: [Module Federation] Failed to bridge external shared module "react-dom/client" Error: Minified React error #527 Companion cloud-portal PR adds the matching host-side entry to federation-host.ts's hostShared() so this actually shares the host's instance instead of falling back to a local one.
2 tasks
scotwells
approved these changes
Sep 11, 2026
mattdjenkinson
approved these changes
Sep 11, 2026
kevwilliams
added a commit
to datum-cloud/cloud-portal
that referenced
this pull request
Sep 11, 2026
## Summary React 19's `createRoot`/`hydrateRoot` live in `react-dom/client`, which Module Federation treats as its own distinct shared module from `react-dom` rather than folding it in automatically. Without a host-side entry, a plugin that imports it (transitively, via some UI dependency) tries to "bridge" against nothing here and crashes with React's own "incompatible react/react-dom versions" invariant instead of cleanly falling back to its own copy — hit by the assistant plugin's chat dock: \`\`\` [Module Federation] Failed to bridge external shared module "react-dom/client" Error: Minified React error #527 \`\`\` ## Companion PR [milo-os/assistant#83](milo-os/assistant#83) adds the matching plugin-side `shared` declaration. ## Test plan - [x] `bun run typecheck` passes - [ ] Confirm the assistant plugin's chat dock renders without this error once both PRs are merged
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
Follow-up to #82. That fix resolved the react-router version-mismatch crash; this fixes the next one that surfaced right after:
```
[Module Federation] Failed to bridge external shared module "react-dom/client"
Error: Minified React error #527
```
React 19's
createRoot/hydrateRootlive inreact-dom/client, which MF treats as its own distinct shared module fromreact-domrather than folding it in automatically. One of this plugin's dependencies imports it (confirmed present in the builtremoteEntry.jsas its own shared chunk), but it was never declared inshared, so MF tried to bridge it against nothing on the host side and crashed with React's "incompatible react/react-dom versions" invariant instead of just using this plugin's own bundled copy.Companion PR
datum-cloud/cloud-portalneeds the matching host-side entry infederation-host.ts'shostShared()so this actually shares the host's instance instead of falling back to a local one — filing that now.Test plan
bun run typecheck/bun run buildpass