You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example tries to reproduce the problem when sharing a dependency that exists in multiple versions across the node modules but resolves the request incorrectly.
Repo that reproduces the issue - https://github.com/tzachbon/mf-shared-deep-dependency
This example tries to reproduce the problem when sharing a dependency that exists in multiple versions across the node modules but resolves the request incorrectly.
In this example repo, I use
uuid
package.This graph shows that the root
uuid
is 8.3.2 and the version underlib
is 3.4.0.lib
uses thev3
method fromuuid
.This method exists only in version 8.3.2.
By default, if we build this project, serve it and click on
new uuid
, everything crashes as expected:But when we use Module Federation and share this package from
app1
like this:We can see that the runtime understands the difference between the packages:
But when we click on
new uuid
which crashed our app, it works (not the desired behavior)...When we look inside the index file, we can see the
moduleToHandlerMapping
resolve it incorrectly:And when we remove the
uuid
entry from theshared
section in ModuleFederationPlugin we can see that the app behaves as expected:For some reason, even when it is explicitly defined to be shared with
^8.3.2
, it matches the3.4.0
version thatlib
consumes.Debug stats:
The text was updated successfully, but these errors were encountered: