Skip to content

TanStack Start: show server function name in traces, errors and other places #21185

@valerii15298

Description

@valerii15298

Problem Statement

When using server functions in traces/errors I see something like this:

/_serverFn/be42578bc8c2e98bb15e6670dd74cb9041e03d44f3988047fbb63f2b32a2eb7c

It is really difficult to understand which server function it is... Which makes debugging a lot harder

Solution Brainstorm

When creating server function there is name attached to it.

const doSomething = createServerFn().handler(() => "so some work");
console.dir(doSomething.serverFnMeta); // has name key

Also in middleware there is serverFnMeta which has name.
Since sentry already has the global function middleware which executes before every server function, it should be possible to get server function name from there.

Would be good to show name of server function to improve debugging.

Additional Context

Related: #20594

Priority

No response

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions