[Feature]: Expose errorInfo from the ErrorBoundary
#9881
Replies: 8 comments 3 replies
-
|
I'm having issue not able to wrap a specific component with a custom |
Beta Was this translation helpful? Give feedback.
-
|
Having the same issue. Would be great to have access to the componentStack |
Beta Was this translation helpful? Give feedback.
-
|
Duplicate proposal closed in favor of this one: #11206 |
Beta Was this translation helpful? Give feedback.
-
Yeah this is where we've landed in our discussions around this, I think we'll be looking into landing some form of API to let you log this information out/send it to Sentry, etc. - but you won't have it in the
Changes are this will basically be a client-side version of the Remix |
Beta Was this translation helpful? Give feedback.
-
|
We have similar request but it's more around how to surface the partial failed deferred promise errors. For example, I have the following loader: export async function loader() {
return {
promise1: new Promise((resolve, reject) => setTimeout(() => {
resolve('stuff');
}, 1000)),
promise2: new Promise((resolve, reject) => setTimeout(() => {
reject(new Response('failed', {status: 404}));
}, 3000)),
};
}It is intentional that I reject a promise with However, there is no way to know that a failed deferred promise happened unless we So maybe ... a hook to log a failed deferred promise on the server-side, with information about a deferred Promise has returned a Response - which is not a proper data format. This is just for this specific example. But it would be nice to know why a deferred promise failed instead of going silent. |
Beta Was this translation helpful? Give feedback.
-
|
Hello! What's the status of this request? Is there any blocker preventing the implementation of the |
Beta Was this translation helpful? Give feedback.
-
|
We are going to implement this as a |
Beta Was this translation helpful? Give feedback.
-
|
This is available in an alpha release via #14162 ( |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
What is the new or updated feature that you are suggesting?
A React
ErrorBoundarycomponentDidCatchexposes two things:error, which is the thrown errorinfo, "An object with a componentStack key containing information about which component threw the error"My understanding is that React Router implements an
ErrorBoundaryand forwards the error toerrorElement, which can get the error by usinguseRouterError. However, only theerroris accessible, not theinfo.My feature request is the following: being able to access, from within the
errorElement, to theinfo.I understand that
getDerivedStateFromErrordoes not exposeinfo, so it might tricky to access it from theerrorElement. In this case, anonError(error, info)callback onRouterProvidermight also be a solution?Why should this feature be included?
Currently, we lose this
infoand, to my knowledge, there's no way to get it back, as we cannot create our own ReactErrorBoundary, given the React Router one takes precedence. Am I wrong?Beta Was this translation helpful? Give feedback.
All reactions