You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to check whether the user has access to a specific page or not.
If they don't have access, I want to throw a custom error and then handle it inside the errorComponent.
Inside the errorComponent, I want to detect whether the error is that specific custom error, and if so, display the error message along with the permissions the user is missing.
But TanStack Start's behavior feels a bit weird here.
During SSR everything works fine and the error data is available correctly.
However, once the client-side hydration/loading happens, the error data gets lost.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to check whether the user has access to a specific page or not.
If they don't have access, I want to throw a custom error and then handle it inside the errorComponent.
Inside the errorComponent, I want to detect whether the error is that specific custom error, and if so, display the error message along with the permissions the user is missing.
But TanStack Start's behavior feels a bit weird here.
During SSR everything works fine and the error data is available correctly.
However, once the client-side hydration/loading happens, the error data gets lost.
Sample :
src/routes/error.tsx:
src/router.tsx:
run and navigate to :
/errorBeta Was this translation helpful? Give feedback.
All reactions