TanStackT
TanStack14mo ago
27 replies
near-sapphire

Redirect to external URL from server function 2

To avoid necroing the original thread,
Tanner has suggested to return a 302 and redirect 'as normal' Redirect to external URL from server function
But this in fact does not work, and instead you get
{"message":"Request failed with status 302","body":{"result":{"$undefined":""},"context":{}}}

so idk how I am supposed to handle this now

EDIT trying t call the server fn from the FE with useServerFn results in
ServerFn Response: 500
 - Payload: {"code":"ERR_HTTP_HEADERS_SENT"}

but like, duh, ofc headers were sent thats how you redirect
Was this page helpful?