Skip to content

Type safety breaks around Dates and other non standard objects when using server functions #2693

Description

@alexgaudon

Which project does this relate to?

Start

Describe the bug

Start Server Functions don't respect TanStack Router specified transformers.

See pictures below:

SuperJSON is specified
Image

Function returns a Date, with the proper type
Image

Loader gets the incorrect type (the actual value is just a stringified date)
Image

Your Example Website or App

https://github.com/AlexGaudon/start-date-repro

Steps to Reproduce the Bug or Issue

  1. Clone the repo
  2. Run bun install
  3. Run bun --bun run dev
  4. Navigate to http://localhost:3000 and observe the error

Expected behavior

As a user, I expect server functions to automatically conform to the transformer specified.

Screenshots or Videos

No response

Platform

  • OS: macOs
  • Browser: Chrome + FireFox
  • Version: latest

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    startEverything about TanStack StarttypesChanges to the typescript types

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions