Throwing RedirectError from server (queries/mutations) does not redirect on the frontend. It seems this case is not handled, as the ErrorBoundary expects the error to have have a url property but raising RedirectError like
// app/projects/queries/getProjects.ts
resolver.pipe((input) => throw new RedirectError("/edit-profile"))
from server sets the message property to /edit-profile instead of setting url to /edit-profile leading an unhandled error where it expects a url but gets undefined/null.
My use case is redirecting the user to edit-profile page if profile is not at least 50% complete if they try to access projects list page
Paste all your error logs here:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'auth')
at Object.formatUrl (format-url.js?2477:32)
at Object.formatWithValidation (utils.js?e766:109)
at resolveHref (router.js?4a0b:169)
at prepareUrlAs (router.js?4a0b:226)
at Router.push (router.js?4a0b:490)
at Object.instance.<computed> [as push] (router.js?9ce1:175)
at ErrorBoundary.eval (error-boundary.js?e551:84)
at Generator.next (<anonymous>)
at asyncGeneratorStep (error-boundary.js?e551:11)
at _next (error-boundary.js?e551:29)
at eval (error-boundary.js?e551:34)
at new Promise (<anonymous>)
at eval (error-boundary.js?e551:26)
at ErrorBoundary.componentDidCatch (error-boundary.js?e551:88)
at ErrorBoundary.callback (react-dom.development.js?61bb:18669)
at callCallback (react-dom.development.js?61bb:13146)
at commitUpdateQueue (react-dom.development.js?61bb:13167)
at commitLayoutEffectOnFiber (react-dom.development.js?61bb:23057)
at commitLayoutMountEffects_complete (react-dom.development.js?61bb:24328)
at commitLayoutEffects_begin (react-dom.development.js?61bb:24314)
at commitLayoutEffects (react-dom.development.js?61bb:24252)
at commitRootImpl (react-dom.development.js?61bb:26411)
at commitRoot (react-dom.development.js?61bb:26280)
at finishConcurrentRender (react-dom.development.js?61bb:25509)
at performConcurrentWorkOnRoot (react-dom.development.js?61bb:25442)
at workLoop (scheduler.development.js?1911:256)
at flushWork (scheduler.development.js?1911:229)
at MessagePort.performWorkUntilDeadline (scheduler.development.js?1911:523)
What is the problem?
https://codesandbox.io/s/fervent-morning-qtvzm
Throwing RedirectError from server (queries/mutations) does not redirect on the frontend. It seems this case is not handled, as the ErrorBoundary expects the error to have have a url property but raising RedirectError like
from server sets the message property to /edit-profile instead of setting url to /edit-profile leading an unhandled error where it expects a url but gets undefined/null. My use case is redirecting the user to edit-profile page if profile is not at least 50% complete if they try to access projects list page
Paste all your error logs here:
Paste all relevant code snippets here:
Minimal code can be found here https://codesandbox.io/s/fervent-morning-qtvzm
What are detailed steps to reproduce this?
yarn dev
http://localhost:3000/check
/some-other-page
we get an error mentioned above.Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
No response