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

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

Open
AlexGaudon opened this issue Nov 2, 2024 · 3 comments
Labels
start Everything about TanStack Start

Comments

@AlexGaudon
Copy link

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

@aretrace
Copy link

aretrace commented Nov 2, 2024

I think a future test suite with various serializers (e.g., Rich-Harris/devalue) would be a good idea.

@SeanCassiere
Copy link
Member

This should be getting addressed in the server functions PR.

@SeanCassiere SeanCassiere added the start Everything about TanStack Start label Nov 2, 2024
@AlexGaudon
Copy link
Author

Just for clarity, are you talking about #2513

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
None yet
Development

No branches or pull requests

3 participants