Should Deferred data aborted
errors have to be caught by our application when navigating between pages?
#8233
Replies: 1 comment 4 replies
-
Using Here's a quick demo of this issue. I know this is a temporary workaround but just want to put this out that using this function will break |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Until upgrading to remix v2 we were noticing stack traces from sentry like this:
(Ignore the missing source map but you get the gist)
In remix v2 these errors are actually shown in the app (good) so it means we were actually able to catch why they were occurring and the solution:
It seems that using
defer(...)
and then the<Await />
component actually requires that the promise returned fromuseLoaderData
is wrapped in something to prevent the abort error from becoming uncaughtWith my function
catchDeferredAbort
beingMy question is: Is this really desired behaviour? If a user is navigating away from a page with a deferred loader, do we really ever want to catch and show something else in place of the deferred data when the page is about to unmount? I guess why is this not caught internally within remix and ignored?
Beta Was this translation helpful? Give feedback.
All reactions