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/runtime
to handle remote modules in a federated setup. When a remote is offline, myoffline-remote-plugin
returns an error message. I also have anErrorBoundary
component to catch errors globally.The issue is:
errorLoadRemote
hook to return a component instead of a string.ErrorBoundary
also triggers.ErrorBoundary
, requiring a full page refresh to reset the error state.Code Implementation
Remote Plugin (
offline-remote-plugin
)Error Boundary
Current Behavior
ErrorBoundary
is also triggered.Expected Behavior
ErrorBoundary
.Possible Solutions Explored
Manually Resetting Error State on Route Change:
componentDidUpdate()
inErrorBoundary
to reset state based on route changes.Conditionally Handling Errors in the Plugin:
errorLoadRemote
instead of a simple error message.ErrorBoundary
.Question
How can I properly return a custom UI from the
offline-remote-plugin
without triggering theErrorBoundary
and ensure that errors reset properly on route changes?Dependencies
Beta Was this translation helpful? Give feedback.
All reactions