Open oytuncoban opened 6 days ago
You can use a runtime plugin to handle such cases, since the v1 way or catching errors was unreliable and did not work for import from ''
The runtime plugin doesn't catch this kind of error, I'm stuck on version 0.1.6 until it get fixed 😢
Describe the bug
Hey, I was using the old Module Federation ('webpack/lib/container/ModuleFederationPlugin'), and decided to migrate to the new Module Federation 2.0.
However, in the previous MF version, I had to implement some ErrorBoundary components:
ErrorBoundary:
DynamicImport:
Usage of DynamicImport:
With this method, I was able to show Error UI when one of the remote is failing and has errors, or unavailable.
With Module Federation 2.0 I now get this error thrown by @module-federation/enhanced:
The versions of used packages:
webpack
:^5.57.1
,@module-federation/enhanced
:^0.2.1
,Example remotes object that I use:
Issue is that, webpack throws error and I cannot use my website as expected. Main goal is to keep Host(Shell) app to be continue working even if a remote fails. Users should be able to use other remotes and shell app layout.
I tried to implement the Dynamic System Host example. Here again, if I don't start one of the remotes, when user tries to load the failing remote, it immediately throws error and breaks the shell.
Wouldn't it be convenient that we can catch the Remote load errors and provide a fallback UI to the user?
Reproduction
https://github.com/module-federation/module-federation-examples/tree/master/dynamic-system-host
Used Package Manager
npm
System Info
Validations