-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
Try to import a react remote into an angular host #3116
Comments
remote configuration looks wrong. esm remotes are usually {key:url} not {key: global@url} |
Thank you for your help. I changed the conf but now I have following error:
I thought we could use a manifest instead of js file. conf in host
|
Make sure remote type is esm and output is esm etc? |
in the NX host angular project, I forced the resolution of @module-federation/enhanced to version 0.6.11 as "@nx/angular": "20.0.3" uses @module-federation/enhanced 0.6.6 and I was told that esm was took in charge from 0.6.8 For my remote react / vite app, I have the following vite.config.js conf (https://github.com/lfaure75/reactViteRemote/blob/master/vite.config.js)
And for the host config I have for tsconfig.base.json (https://github.com/lfaure75/nx-angular-workspace/blob/main/tsconfig.base.json)
Is there someting I missed ? |
I changed my way to import my react remote and I am trying to use dynamic module federation. But do we have a way to indicate to my angular host that my react remote is exposing a manifest file dans not a js ? When loading my remote, it's adding by default remoteEntry.mjs at the end of my url exposed in module-federation.manifest.json. So having a 404 error: http://localhost:4173/assets/remoteReactViteManifest.json/remoteEntry.mjs So in my module-federation.manifest.json
in the main.ts
in the app.routes.ts
|
@Coly010 this seems like they are doing it wrong. Anything you can advise on angular? |
Yeah it’s being done wrong. see example here: https://github.com/Coly010/advanced-module-federation-examples/tree/main/examples/angular-react-mfes/react-in-angular |
Web component or something like a framework bridge like we mention on our documentation site. |
Describe the bug
Hello,
I am trying to import a react VITE remote into an angular host built with NX.
When I load the host I have a blank page with the following error in the console:
My react remote is built with VITE:
repo: https://github.com/lfaure75/reactViteRemote
For my host, I created a angular component in order to wrap my react remote and update the routes:
repo: https://github.com/lfaure75/nx-angular-workspace
my wrapped component:
the routes:
module federation:
I have the package "@module-federation/enhanced": "0.6.11"
Many thanks in advance for your help
Reproduction
https://github.com/lfaure75/nx-angular-workspace
Used Package Manager
yarn
System Info
Validations
The text was updated successfully, but these errors were encountered: