TanStack / TanStack/router

Server Functions body limit

Open
#3,953 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

start
Dominant language
TypeScript
Stars
15.1k
Forks
1.9k
Avg merge
1d 20h
Merged PRs (30d)
143

Description

Which project does this relate to?

Start

Describe the bug

the current implementation server function buffer everything in memory since there no body limit like next.js server action this allow any user to upload large payloads to any server function POST endpoint. if dev not handled this properly this can cause OOM if self-hosted

Your Example Website or App

https://tanstack.com/_server/app_utils_config_ts--getTanstackDocsConfig_createServerFn_handler?payload=%7B%22data%22%3A%7B%22repo%22%3A%22tanstack%2Frouter%22%2C%22branch%22%3A%22main%22%2C%22docsRoot%22%3A%22docs%2Fstart%22%7D%2C%22context%22%3A%7B%7D%7D&createServerFn

Steps to Reproduce the Bug or Issue

send large payloads (binary, form data, etc.) to any server function endpoint

Expected behavior

abilty to set body limit globally and per server function

Screenshots or Videos

Image

test upload 100MB file to tanstack.com server function endpoint

Platform
  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named in the issue. Start by locating the server function POST endpoint and its request-body handling, then reproduce the behavior with a large payload. Done means server functions enforce a configurable global body limit and allow a per-function limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.