Open nekochan0122 opened 1 week ago
a temporary solution:
async function handleResponse<ResponseBody = unknown>(response: Response): Promise<ResponseBody> {
const event = getEvent()
setHeaders(event, Object.fromEntries(response.headers))
switch (response.headers.get('Content-Type')) {
case 'application/json':
return response.json() as ResponseBody
default:
return response.body as ResponseBody
}
}
Which project does this relate to?
Start
Describe the bug
Server functions should able to return Raw Response objects.
Your Example Website or App
https://github.com/nekochan0122/tanstack-start-return-response-object
Steps to Reproduce the Bug or Issue
Expected behavior
{ hello: "world" }
test=test
Screenshots or Videos
No response
Platform
Additional context
No response