T
TanStack3mo ago
sunny-green

redirects when using createServerFn

using redirect with the new setupRouterSsrQueryIntegration({ router, queryClient, }); seems to be breaking. when i remove it. it works. Any solution.
2 Replies
absent-sapphire
absent-sapphire3mo ago
please provide a complete reproduction project
sunny-green
sunny-greenOP3mo ago
i was wrong. it works with the redirect. i think the redirect doesnt refresh the queryclient. i didnt have this issue till i tried the recent update. i set a cookie before redirect and it doesnt work. the cookie is set but at the end of redirect. i cant tell where the issue is from. the only way it works is when i set reloadDocument to true in the redirect. also in the _root.tsx it works when i do this
const session = await context.queryClient.ensureQueryData(authQuery.session);
const session = await context.queryClient.ensureQueryData(authQuery.session);
but fails with

const session = await context.queryClient.ensureQueryData(authQuery.session);

const session = await context.queryClient.ensureQueryData(authQuery.session);

Did you find this page helpful?