Open jwq403926021 opened 4 hours ago
exposed modules are not guarenteed to be singleton, the host and remote have seperate runtime containers and module graphs. only mitt would be singleton, the exposed item would not be in this case, youd need a runtime chunk single but that may cause other issues unless you have an additional ContainerPlugin with runtime: false set on it so that you have one for when the hosts own remote is loaded into the page, and another for if the host is not the same app as a remote being loaded. the exposed thing is not singleton, but its import of mitt is.
if you shared the thing you expose, it would probbably work
Describe the bug
Why is the mitt() instance not singleton ??
Here is the shared function instance code. This code is shared by host app.
Here is the host federation config.
Here is the usage from host app. Using the instance directly.
Here is the usage from remote app. Using the instance by shared module.
Reproduction
reproduction
Used Package Manager
pnpm
System Info
Validations