Closed bazo closed 1 month ago
Should be fixed in latest!
Still seeing this in 1.28.7
as seen in other issues, downgrading to 1.28.1
is a solid workaround
+1
Another scenario involves manually entering a URL that belongs to an authenticated layout directly into the address bar. If I navigate to that page manually, not using a Link or navigate function, the same error occurs.
yeah still happens, even on 1.28.9
Still happens in 1.28.9
as seen in other issues, downgrading to
1.28.1
is a solid workaround
Can confirm, downgrading from 1.28.7
to 1.28.1
fixes the issue temporarily.
Seeing this is broken in latest as well
Can confirm this is a degradation from 1.28.2
and still exists in 1.29.2
.
Working: https://stackblitz.com/edit/vitejs-vite-qsrurg?file=src%2Frouter.tsx Failing: https://stackblitz.com/edit/vitejs-vite-m1s4ek?file=src%2Frouter.tsx
using the official example, even on latest version 1.29.2
or 1.28.1
, although it works just fine when using the <Link>
component to navigate, it keeps throwing the Uncaught
error when manually navigating to /dashboard
url
As mentioned above, this occurs to me when I initially hard-load the route that includes redirect
in the browser address bar. It works well when navigating to that page on client side.
Still happens in 1.29.2
Also happens using loader in route.
Experiencing the same issue.
Same here, but it only happens in my prod build.
I downgraded to 1.28.1
and it worked again.
"@tanstack/react-router": "^1.29.2",
"@tanstack/router-vite-plugin": "^1.30.0",
"vite": "^5.2.10",
Still happening with the latest version.
Error:
Code:
"@tanstack/react-router": "^1.30.1",
"@tanstack/router-devtools": "^1.30.1",
"@tanstack/router-vite-plugin": "^1.30.0",
import { createFileRoute, redirect } from "@tanstack/react-router";
export const Route = createFileRoute("/")({
beforeLoad: () => {
throw redirect({ to: "/home" });
},
});
Hey, I just tested the new change, and while redirect does work, now it does not show Outlet content. You can see the behavior here: https://stackblitz.com/edit/vitejs-vite-pcqzrt?file=src%2Fmain.tsx
There is no more error in the console, but the redirect does not load the current page and leave me with an empty screen.
There is no more error in the console, but the redirect does not load the current page and leave me with an empty screen.
Same here
Tested in
@tanstack/react-router": "^1.31.3
and it seems that redirect doesn't work, i.e.
throw redirect({ to: '/' });
will redirect to current page and not to: '/'
Wrapping the <RouterProvider router={router} />
in Suspense component helped me to resolve this issue.
Wrapping the
<RouterProvider router={router} />
in Suspense component helped me to resolve this issue.
This does not seem to help for our case. throw redirect({ to: '/login', search: { redirect: location.href }});
is changing the url, but showing a blank screen, suggesting indeed the Outlet is not rendering?
Ah, version 1.31.20 seems to have a fix! 🙌 Probably https://github.com/TanStack/router/commit/51eb39b85ec437bb46c831ef388a9dc7ecb23c35 fixed it, it is working after updating. Thanks!!
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://stackblitz.com/edit/github-qtxl7r?file=src%2Fmain.tsx
Steps to Reproduce the Bug or Issue
run the app open console try to go to /posts
this error is thrown router.ts:1607 Uncaught (in promise) {to: '/login', search: {…}, isRedirect: true, statusCode: 301, headers: {…}, …}
Expected behavior
i am redirected to login page
Screenshots or Videos
No response
Platform
Additional context
No response