Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start: createServerFn cannot return null #2776

Open
SeanCassiere opened this issue Nov 15, 2024 · 1 comment
Open

Start: createServerFn cannot return null #2776

SeanCassiere opened this issue Nov 15, 2024 · 1 comment
Labels
start Everything about TanStack Start

Comments

@SeanCassiere
Copy link
Member

Which project does this relate to?

Router

Describe the bug

All details are found in this discussion thread on Discord - https://discord.com/channels/719702312431386674/1306957125246914590

The crust of the matter is that you aren't able to return null from a createServerFn call.

const fn = createServerFn().handler(async () => {
    return null
})

await fn(); // undefined

Your Example Website or App

https://discord.com/channels/719702312431386674/1306957125246914590

Steps to Reproduce the Bug or Issue

Create a server function returning null and see that at runtime it does not return the value, instead, it returns undefined.

Expected behavior

The returned null value from the server function should correctly get piped down to the caller.

Screenshots or Videos

No response

Platform

N/A

Additional context

No response

@SeanCassiere SeanCassiere added start Everything about TanStack Start information needed Further information is requested labels Nov 15, 2024
@SeanCassiere
Copy link
Member Author

SeanCassiere commented Nov 15, 2024

Need to investigate the issue.

The issue/bug has been investigated and a reproduction has been created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
start Everything about TanStack Start
Projects
Status: Ready
Development

No branches or pull requests

1 participant