Loading failing remotes throws Runtime Error #2667
Replies: 1 comment
-
I wanted to implement the Dynamic System Host example, but, the example throwing the same error with rspack or webpack builds. Update: My bad, remotes of the example weren't configured to allow headers. After the configuration, it worked. Is there any way without editing the whole codebase according to the dynamic load with init() and loadRemote()? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.
How should I get the old behavior? Or, what should I do to dynamically load the hosts on runtime?
How can I learn the best practices?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions