When, and what types of errors <ErrorBoundary> catch?
The docs are not clear about exactly what types of errors are caught by
But errors occurring outside the rendering process, for example, in event handlers or after a
<ErrorBoundary>
. My understanding is that:
<ErrorBoundary>
catches any error that occurs during rendering or updating its children. That includes:
- Errors that occur while rendering the JSX.
- Errors that occur within createEffect
, createMemo
, and other synchronous state management primitives.
But errors occurring outside the rendering process, for example, in event handlers or after a
setTimeout
or async work are not caught by error boundaries.
Is that accurate? Are there other scenarios that I'm missing?5 Replies
yes you are missing this case
https://playground.solidjs.com/anonymous/78077569-47d3-476b-8927-d8b668903100
@ryansolid is this a bug or bad usage
Bad usage. You can see it from the types. Doesn't accept a function as children
yeah thought so, but didn't see any warning in the playground.
I see red sqiggly
you are right, something was wrong in the tab, I opened in a new tab and I see it
