Skip to content

ServerFunction does not serialize from client-side loader invocation #7437

@arackaf

Description

@arackaf

Which project does this relate to?

Start

Describe the bug

I'm seeing the most boring server function imaginable fail to de-serialize when called from a client-side loader.

Repro below

Complete minimal reproducer

https://github.com/arackaf/my-blog/tree/special/bug-repro

Steps to Reproduce the Bug

Clone
npm i
npm run dev
browse here: http://localhost:3000/blog/swift-codable-any
then click the back arrow at the top

Page should error out. But then refresh the page on that root url - it should load

What's crazy is that the serverFn in that root url returns static data. I can't imagine what's making it fail to serialize

.handler(async () => {
return [
{
markdownContent: "",
title: "Swift - Encoding and decoding Any",
date: "2022-07-12T10:00:00.000Z",
description: "How to encode and decode json with concrete types, which include dynamic pieces typed as Any",
slug: "swift-codable-any",
},
];

Expected behavior

Should work :)

Screenshots or Videos

n/a

Platform

  • Router / Start Version: [e.g. 1.121.0]
    "@tanstack/react-router": "^1.170.4",
    "@tanstack/react-start": "^1.168.6",
  • OS: [e.g. macOS, Windows, Linux]
    macOS
  • Browser: [e.g. Chrome, Safari, Firefox]
    Chrome
  • Browser Version: [e.g. 91.1]
    148
  • Bundler: [e.g. vite]
    Vite
  • Bundler Version: [e.g. 7.0.0]
    7.1.7

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions