T
TanStack10mo ago
rare-sapphire

Returning response object no longer works.

I upgraded to 1.82.1 and i have a serverFn that looks like this with the new syntax:
export const fetchPdf = createServerFn({ method: 'GET' })
.validator((data: { url: string }) => data)
.handler(async ({ data: { url } }) => {
return fetch(url)
})
export const fetchPdf = createServerFn({ method: 'GET' })
.validator((data: { url: string }) => data)
.handler(async ({ data: { url } }) => {
return fetch(url)
})
previously this used to fetch the url, but now it does not, and inferred types from calling the function is any Is there a new way to do this returning response object?
5 Replies
extended-salmon
extended-salmon10mo ago
extended-salmon
extended-salmon10mo ago
GitHub
Start: createServerFn cannot return raw response objects · Issue #2...
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-ret...
extended-salmon
extended-salmon10mo ago
also includes a temporary solution by Nekochan
wise-white
wise-white10mo ago
is this a bug or they have changed the design itself?
extended-salmon
extended-salmon10mo ago
Bug

Did you find this page helpful?