module-federation-examples icon indicating copy to clipboard operation
module-federation-examples copied to clipboard

Issue with route sharing between host and inner apps

Open morleytatro opened this issue 3 years ago • 1 comments

I'm trying to set up a basic host app which shares routing with two inner apps. I've bumped into a few snags which are probably user error:

  • switching between the dashboard and marketplace routes leads to this error and a seeming dismount of some of the children: https://github.com/facebook/react/issues/23202
  • I can't seem to load the two inner apps synchronously without using lazy even though I've established an async boundary.
  • I'm seeing some dependency duplication in the console even though I'm attempting to share them.

https://github.com/morleytatro/module-federation

Is there anything obviously wrong with the Webpack configs? Thanks!

morleytatro avatar Apr 20 '22 16:04 morleytatro

hmm interesting. I see this is using react 18.

ive cloned your repo and will try to see whats going on here, cant see anything immediately wrong. im wondering if maybe you should set the container app to share these modules with eager:true, since its always the host and you basically want to force those singletons to come from the parent application.

Remotes not eager, host eager, remote loads shared module async only if needed, host provides shared modules upfront that it has

ScriptedAlchemy avatar Apr 29 '22 05:04 ScriptedAlchemy