Closed zshlomyz closed 1 week ago
Hi, I'm still facing the issue - no way to use the package at a micro frontend application. Can you help, please?
Hi! I am facing the same issue! It seems that the library have no idea about how to share or reuse the instance in the mfe remotes. Hope we could find a solution soon 😞 In the meantime we are looking for an alternative package or just do the post the old way.
I have no idea what "module federation" means for a library. Is there anything special we should do ? or is it supposed to work magically ? No idea !
And I won't research it either. But I will merge a PR if one you can come up with a solution, and explanation. Until then I close the issue, because this is not something I work on personally.
I'm using @angular-architects/module-federation to split the code into micro frontends. I'm using named client in my MFE to support multiple clients. The module (module1) that use Apollo is configured like that:
I'm using the named client on the query like that:
query myQuery{ data @namedClient(name: "client1") .....
and use it like that:When I run the MFE by itself, it bootstraped by the app.module of the MFE load module1 and the ApolloModule and it works. When I load module1 using @angular-architects/module-federation, the app.module of the shell is import the ApolloModule but there is an error:
To Reproduce Steps to reproduce the behavior:
Another try I've also tried to solve it by replacing the myQueryGQL with apollo code like that -
When I used this syntax it works by making the call trough a component of the MFE but when I make the call at a service at the MFE I got the error:
Environment: