Closed yoniabitbolkryon closed 4 months ago
Hey!
I had a similar issue. When you have multiple exposes in MFE the module federation plugin automatically changes the export in the federation entry point and then you don't have a default export.
In my case, the below fixes the issue, and modules were loaded correctly when there was a single or multiple exposes.
const remote = await federation.__federation_method_getRemote(moduleName, exposeName);
return "default" in remote ? remote : { default: remote };
Hey!
I had a similar issue. When you have multiple exposes in MFE the module federation plugin automatically changes the export in the federation entry point and then you don't have a default export.
In my case, the below fixes the issue, and modules were loaded correctly when there was a single or multiple exposes.
const remote = await federation.__federation_method_getRemote(moduleName, exposeName); return "default" in remote ? remote : { default: remote };
thank you, it worked! :)
Versions
Reproduction
MFE vite.config.ts:
Host vite.config.ts:
Host App.jsx:
Steps to reproduce
Project reproduction: vite.zip
What is Expected?
The Host should display 2 component showing list of Pokémon.
What is actually happening?
page is empty and Console has multiple errors: