How can I set HTTP response code during SSR?
When I throw errors in root loader, it still returns 200, though it shows my error component properly. "setResponseCode" seems to not change anything. Throwing "notFound()" and "redirect()" seems to work for their respective purposes, but I want a 500 error page (or any arbitrary status code page).
3 Replies
extended-salmon•5mo ago
Are you using the "useServerFunction" hook?
fascinating-indigoOP•5mo ago
In the route's loader() I didn't think it was needed, though I can try it in a bit.
extended-salmon•5mo ago
I am sorry, I missed this detail