TanStack / TanStack/router

Calling any server function from the client entry point breaks custom serialization adapters

Open
#7,706 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.1k
Forks
1.9k
Avg merge
1d 20h
Merged PRs (30d)
143

Description

Which project does this relate to?

Start

Describe the bug

Calling a server function that uses a custom serialization adapter throws a SerovalDeserializationError when any server function is called from the client entry point (client.tsx).

  1. Define a startInstance with custom serializationAdapters in start.ts
  2. Call any server function from the client entry point
  3. Call a server function that uses a custom serialization adapter
  4. A SerovalDeserializationError occurs
Complete minimal reproducer

https://github.com/roccomaniscalco/tanstack-start-createSerializationAdapter

Steps to Reproduce the Bug
  1. pnpm i && pnpm dev
  2. open localhost:3000
  3. Click "Get Animal" button
  4. Observe SerovalDeserializationError in console
Expected behavior

As a user, I expected custom serialization adapters to deserialize successfully, but instead I am seeing a SerovalDeserializationError.

Screenshots or Videos

No response

Platform
  • Router / Start Version:
    "@tanstack/react-router": "1.170.16",
    "@tanstack/react-start": "1.168.26",
    
  • OS: macOS
  • Browser: Chrome
  • Browser Version: 149.0.7827.156 (Official Build) (arm64)
  • Bundler: vite
  • Bundler Version: ^8.0.0
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the client.tsx and start.ts entry points described in the reproduction, then run the linked minimal reproducer with pnpm i && pnpm dev. Trace the server-function calls and custom serialization adapter usage until the SerovalDeserializationError occurs; done means the Get Animal flow deserializes successfully after another server function is called from the client entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript, vite
Domain
api, full-stack
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.