TanStack / TanStack/router

Make SSR HTML buffer configurable

Open
#7,942 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

TanStack Start: Make SSR HTML buffer configurable

When rendering a lot of html in ssr mode I am getting this error: Error in renderToReadableStream: Error: SSR router HTML exceeded maximum buffer

I did find out it in source code here: https://github.com/TanStack/router/blob/d3e1cf4e2f1be7dc980afde8575aa40c339f9dc0/packages/router-core/src/ssr/transformStreamWithRouter.ts#L618

Reproduction

https://github.com/valerii15298/tss-repros/tree/html-exceeded-maximum-buffer

Expected behavior

The buffer size should be configurable

  • Router / Start Version: latest as of this issue creation
Additional context

Discord: https://discord.com/channels/719702312431386674/1527695663373095032

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

Start in packages/router-core/src/ssr/transformStreamWithRouter.ts around line 618, where the SSR router HTML buffer error is reported. Run the linked tss-repros html-exceeded-maximum-buffer reproduction to observe the failure. Done means the SSR HTML buffer size can be configured and the reproduction no longer fails at the default limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.