-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Which project does this relate to?
Start
Describe the bug
Hi, I'm testing with server function returning raw response object and found two issues:
- When the response contains header value
Content-Type: 'application/json', the result of the server function when calling from client would beundefined - Typing issue when trying to return a raw response from server function
Argument of type '() => Promise<Response>' is not assignable to parameter of type 'ServerFn<Register, Method, undefined, undefined, Response>'.
Type 'Promise<Response>' is not assignable to type 'ServerFnReturnType<Register, Response>'.
Type 'Promise<Response>' is not assignable to type 'Promise<{ readonly headers: { append: "Function is not serializable"; delete: "Function is not serializable"; get: "Function is not serializable"; getSetCookie: "Function is not serializable"; ... 6 more ...; [Symbol.iterator]: "Function is not serializable"; }; ... 13 more ...; text: "Function is not serializable";...'.
Your Example Website or App
Steps to Reproduce the Bug or Issue
- Create a server function
serverFn - Return
new Responsewith request body is something likenew Blob([JSON.stringify({ a: 1 })]) - Set the header value of the new Response to
Content-Type: 'application/json' - Calling the server function
serverFnfrom client code, observe the browser console - It shows
undefined
Expected behavior
- The server function should return
Response - No typing issue
Screenshots or Videos
No response
Platform
- Router / Start Version: 1.132.18
- OS: macOS/Linux
- Browser: Chrome
- Browser Version: [e.g. 91.1]
- Bundler: [e.g. vite]
- Bundler Version: [e.g. 7.0.0]
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels