-
Notifications
You must be signed in to change notification settings - Fork 19
Add module federation support by adding package.json export #531
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
Add module federation support by adding package.json export #531
Conversation
Signed-off-by: hEAVEN <[email protected]>
91e05ee
to
3d110b6
Compare
Hey @Facegrinder, can you share a reproducible example for the error? |
Looks like this should be fixed: module-federation/vite#246 But here's what I see when running
So the fix isn't working 🤔 For context: Not exporting package.json is not wrong. |
Did you apply the fix to both the host and remote? The error you mentioned is also happening for me as well. |
I've filed module-federation/vite#293 and opened a PR with a fix: module-federation/vite#294 Closing this. For context: Even if we add a package.json export here, you're very likely to run into the same problem with |
Alright, nice. When do you expect that change to be released? |
I hope it'll get accepted and released soon, but it's up to the module-federation/vite maintainers. In the meantime, I'd use https://github.com/ds300/patch-package to add an export for package.json to @connectrpc/connect-query (and others where necessary). |
The new version with this fix, Module Federation Vite v1.2.7 is out now 👏 |
Hi, I wanted to use connect-query in my microfrontend project which uses Vite Module Federation.
I need to specify connect-query as singleton like this:
Without my suggested fix, I get this in the browsers console:
[ Federation Runtime ] Warn Version 0 from userFrontend of shared singleton module @connectrpc/connect-query does not satisfy the requirement of host which needs ^2.0.1)
The output of the host/frontend in the console:
My PR fixes this warning/error.