Skip to content

The boilerplate code in server entry point docs is giving type error #7399

Open

Description

@flexdinesh

Which project does this relate to?

Start

Describe the bug

The boilerplate code in the Server Entry Point TanStack Start docs page is giving type errors.

import handler, { createServerEntry } from '@tanstack/react-start/server-entry'

type MyRequestContext = {
  hello: string
  foo: number
}

declare module '@tanstack/react-start' {
  interface Register {
    server: {
      requestContext: MyRequestContext
    }
  }
}

export default createServerEntry({
  async fetch(request) {
    return handler.fetch(request, { context: { hello: 'world', foo: 123 } })
  },
})

Complete minimal reproducer

https://github.com/flexdinesh/tanstack-start-request-context-repro/blob/main/src/server.ts

Steps to Reproduce the Bug

  1. bootstrap a new tanstack app pnpm dlx @tanstack/cli@latest create
  2. create src/server.ts file
  3. copy paste the code from docs

Expected behavior

The types should be inferred and shouldn't show an error

Screenshots or Videos

Image

Platform

  • Router / Start Version: 1.169.2
  • OS: macOS
  • Bundler: vite
  • Bundler Version: 8.0.12

Additional context

No response

Activity

  1. SeanCassiere commented on May 17, 2026

    @SeanCassiere
    Member

    The issue that the docs were wrong for this. It should have been module declartion onto the @tanstack/react-router library instead.

  2. SeanCassiere commented on May 18, 2026

    @SeanCassiere
    Member

    Re-opening the issue since we're also investigating trying to make the original code-snippet work. Just assessing the impact of the change.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions