Skip to content

ServerFn started converting null to undefined in RC version #5416

@jakst

Description

@jakst

Which project does this relate to?

Start

Describe the bug

When sending just the value null to a serverFn, without wrapping it in an object, it is converted to undefined once it reaches the handler.

This is a regression in the RC version of Tanstack Start.

Your Example Website or App

https://github.com/jakst/tanstack-start-null-data-serverfn

Steps to Reproduce the Bug or Issue

  1. Install deps with pnpm install and start dev server with pnpm dev
  2. Open http://localhost:3000
  3. Click the button that says Call serverFn with data = null
  4. Observe the error message. The serverFn received data = undefined instead of data = null

Expected behavior

I expect null values to be preserved in the serverFn.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.132.51
  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Browser Version: [e.g. 91.1]
  • Bundler: vite
  • Bundler Version: 7.1.9

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions