Skip to content
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

@module-federation/bridge-react package bundles react-dom/client (v18) code #3477

Closed
5 tasks done
francisduvivier opened this issue Feb 3, 2025 · 1 comment
Closed
5 tasks done

Comments

@francisduvivier
Copy link
Contributor

francisduvivier commented Feb 3, 2025

Describe the bug

When we were trying to use bridge-react to include a react v19 federated module safely into a react v18 host with react-bridge and react-runtime, we noticed that it does not work. The first reason for this that we can see is that the @module-federation/bridge-react is currently bundling react-dom/client.

This bundling looks accidental to me, so I opened a PR to fix it ( #3476 ).

Reproduction

  • Check out this repository

  • build the bridge-react package

  • check the imports in bridge-react/dist/index.es.js

    • You will see that there is no import for react-dom/client, instead the code is bundled below containing __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED on line 333
  • Alternatively to the steps above you can also check the bundle at https://www.npmjs.com/package/@module-federation/bridge-react?activeTab=code and then @module-federation/bridge-react/dist/index.es.js line 333

Used Package Manager

pnpm

System Info

Not applicable

Validations

@danpeen
Copy link
Contributor

danpeen commented Feb 11, 2025

issue fixed.

@danpeen danpeen closed this as completed Feb 11, 2025
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

No branches or pull requests

2 participants