-
Notifications
You must be signed in to change notification settings - Fork 375
[Bug]: Module Federation Runtime with Pages + useDataLoader crashes #6855
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
Comments
Oh, I know what you want. But we have not support get Data in server with module federation together now. It's still on design phase, and we do some attempt in internal framework, maybe the feature will expose in Modern.js in a few months. |
Should we keep this open to track? |
Keep open ! I added a new tag as feature request~ |
Hi @zackarychapple, I'm experiencing the same issue here and decided to try the exact approach you used. I believe the error was resolved by adjusting the shared configuration in the producer:
However, it's important to note that this change unfortunately does not address the server data not being obtained. I made this change because I found a similar problem in Remix, where having two versions of react-router-dom caused issues. You can see more details here: @zllkjc I work at a company that is planning to move away from Next.js. We heavily use Module Federation, and our plan is to transition to Modern.js. However, as you said Modern.js currently doesn't support fetching server data together with Module Federation. Do you have any suggestions for how we might achieve SSR with federated modules, even if it's not the ideal solution? Thanks in advance for your help! |
I want but I can't. Perhaps it is better to do We discuss it with module-federation team members now, I think this is a interesting feature. |
@zllkjc can we have a quick sidebar conversation about this with the Modern team on Lark to help answer questions quick? |
Thats a good thing to check, I'll tag @swalker326 and @zmzlois in on this too. |
Hi @zackarychapple, I hope you're doing well. I wanted to contribute to modernJS, so I've been running some tests and have successfully managed to serve federated modules using SSR. I've updated the repository with our current implementation approach. To test please use Repository: https://github.com/joselrodrigues/ssr-modernjs Best regards |
Version
Details
We have a goal of using Module Federation together with ModernJS. The repository I am creating is trying to leverage enhanced to attempt to demonstrate several capabilities.
enhanced/runtime
(this works)Reproduce link
https://github.com/zackarychapple/modern-mf-example2
Reproduce Steps
When we import this remote into the header we are able to see the Async boundary as well as the delay in loading. Our initial understanding was that because this is wrapped in Await, the data fetch to the Pokemon api would be performed on the server (especially since this is being run with ssr streaming mode enabled.
After some further digging we made an attempt to expose another federated remote that has
useLoaderData
which does in fact do SSR and only renders the data when pulled up manually. However when we try to federate it into the header we get an error.The error
Questions
Should we be using this methodology in the components themselves
Or should we be using this in the
module-federation.config.ts
that is loaded via themoduleFederationPlugin
inmodern.config.ts
The text was updated successfully, but these errors were encountered: