T
TanStack2y ago
flat-fuchsia

Error on `beforeLoad` return

I have an asynchronous beforeLoad function. Its not clear to me why, but sometimes (especially when running in Safari on mobile) there is an error. Refreshing the page always fixes the problem. However, my main issue is that the error message is:
Unhandled Promise Rejection: [object Object]
(anonymous function) - router.ts:1613
enqueueJob
(anonymous function) - router.ts:1607
Unhandled Promise Rejection: [object Object]
(anonymous function) - router.ts:1613
enqueueJob
(anonymous function) - router.ts:1607
Is there anything I can do to get a more helpful error message and start tracking down the problem?
2 Replies
flat-fuchsia
flat-fuchsiaOP2y ago
It turns out that the issue is https://github.com/TanStack/router/issues/1480
GitHub
Redirect from beforeLoad: uncaught error · Issue #1480 · TanStack/r...
Describe the bug when checking if user is authenticated and throwing a redirect from before load an unhandled error is thrown instead of redirect happenning Your Example Website or App https://stac...
flat-fuchsia
flat-fuchsiaOP2y ago
Safari is supremely unhelpful with its error logging

Did you find this page helpful?