Skip to content

Creating reusable server functions ignores setting the method: "GET" | "POST" #5872

Closed

Description

@julianklumpers

Which project does this relate to?

Start

Describe the bug

export const publicServerFn = createServerFn().middleware([localeMiddleware]);
export const authenticatedServerFn = publicServerFn.middleware([authMiddleware]);

this works, but there is a small problem. i get TS types for setting a method: "POST" | "GET", but it is not working, i always get a "GET" when setting a "POST"

authenticatedServerFn({ method: "POST" }).handler(...) // still results in a GET

Your Example Website or App

https://codesandbox.io/p/devbox/silly-dan-3lxwm6?workspaceId=ws_6zSt1ovMaptBGeGs92eGau

Steps to Reproduce the Bug or Issue

  1. open the console tab and go to network tab
  2. click "Create Post"
  3. check in the network tab the request method

Expected behavior

When setting {method: "POST"} i expect the server function request to be a "POST" and not a "GET"

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.136.4
  • OS: macOS
  • Browser: Chrome,
  • Browser Version 142.0.7444.162 (Official Build) (arm64)
  • Bundler: vite
  • Bundler Version: 7.1.7

Additional context

No response

Activity

  1. KirtiGautam620 commented on Nov 15, 2025

    @KirtiGautam620

    Hi! I’d like to work on this issue where authenticatedServerFn({ method: "POST" }) always sends a GET request instead of POST. Could you please assign this issue to me?

  2. schiller-manuel commented on Nov 15, 2025

    @schiller-manuel
    Collaborator

    @KirtiGautam620 just create a PR for it
    make sure to also update the e2e server-functions tests

  3. added a commit that references this issue on Nov 22, 2025
    2fd4cba
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