Skip to content

1.97 Server fn headers are incomplete on initial load #3173

@dotnize

Description

@dotnize

Which project does this relate to?

Start

Describe the bug

In Start 1.97, request headers and cookies from helper functions in @tanstack/start/server or vinxi/http (e.g. getWebRequest) are initially incomplete in server functions called in loaders/beforeLoad, breaking auth stuff.

When navigating/loading another page which will re-trigger beforeLoad, getWebRequest() returns the complete headers.

Your Example Website or App

https://github.com/dotnize/tss-webrequest-server-fn

https://tss-webrequest-server-fn.vercel.app/

Steps to Reproduce the Bug or Issue

  1. Clone repo and run dev
  2. Load any page. Headers returned and logged from server fn loader will be incomplete.
  3. Navigate to /test or /. Complete headers are now returned.

This is reproducible in dev and build.

Expected behavior

Complete headers are always returned by getWebRequest in 1.95.x

Screenshots or Videos

Screencast.From.2025-01-15.16-54-05.mp4

Platform

  • OS: [Linux]
  • Browser: [Chrome, Firefox]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions