T
TanStack11mo ago
eastern-cyan

setStatus or setResponseStatus doesn't work in server functions

I'm trying to set status code in server fn but it just ignores it and returns 200
9 Replies
narrow-beige
narrow-beige11mo ago
can you please provide a minimal complete example by forking one of the existing examples?
eastern-cyan
eastern-cyanOP11mo ago
Can I provide a github repo?
narrow-beige
narrow-beige11mo ago
of course
eastern-cyan
eastern-cyanOP11mo ago
GitHub
GitHub - Danieljs-codes/Start-repro
Contribute to Danieljs-codes/Start-repro development by creating an account on GitHub.
eastern-cyan
eastern-cyanOP11mo ago
Check the index.tsx I created on server function in /utils/action and I am calling it on the home page See everything works but it returns it with a 200 status code It doesn't work on stackblitz cause I think vinxi can't access the AsyncLocalStorage
narrow-beige
narrow-beige11mo ago
GitHub
Release v1.69.2 · TanStack/router
Version 1.69.2 - 10/15/24, 10:31 PM Changes Fix start: correctly handle custom response status codes (#2553) (77fe390) by Manuel Schiller Test Add test cases for route id consistency (#2401) (ac...
eastern-cyan
eastern-cyanOP11mo ago
Installed this but it seems like it breaks redirect @Manuel Schiller
eastern-cyan
eastern-cyanOP11mo ago
throw redirect({
to: "/",
});
throw redirect({
to: "/",
});
It redirects before now it shows this
No description
narrow-beige
narrow-beige11mo ago
sorry, fixed again

Did you find this page helpful?