Issue: Custom UI for Offline Remote Plugin Persists Error State in Error Boundary #3612
Unanswered
basit-qayoom
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
❓ Issue: Custom UI for Offline Remote Plugin Persists Error State in Error Boundary
Description
I'm using
@module-federation/enhanced/runtimeto handle remote modules in a federated setup. When a remote is offline, myoffline-remote-pluginreturns an error message. I also have anErrorBoundarycomponent to catch errors globally.The issue is:
errorLoadRemotehook to return a component instead of a string.ErrorBoundaryalso triggers.ErrorBoundary, requiring a full page refresh to reset the error state.Code Implementation
Remote Plugin (
offline-remote-plugin)Error Boundary
Current Behavior
ErrorBoundaryis also triggered.Expected Behavior
ErrorBoundary.Possible Solutions Explored
Manually Resetting Error State on Route Change:
componentDidUpdate()inErrorBoundaryto reset state based on route changes.Conditionally Handling Errors in the Plugin:
errorLoadRemoteinstead of a simple error message.ErrorBoundary.Question
How can I properly return a custom UI from the
offline-remote-pluginwithout triggering theErrorBoundaryand ensure that errors reset properly on route changes?Dependencies
Beta Was this translation helpful? Give feedback.
All reactions