Skip to content
Source
Sign inSign up
TanStack/router

[BUG]: All headers added by tanstack start are malformed when using rsbuild #7344

Send to my agent
Closedsadan4(GitHub profile, opens in a new tab) opened this issue 1 comment

Which project does this relate to?

Start

Describe the bug

When using rsbuild, any response headers added by tanstack will be malformed.

actual headers

Headers {
  '0': 'content-type',
  '1': 'text/html; charset=utf-8',
  vary: 'Origin',
  date: 'Tue, 05 May 2026 04:30:34 GMT',
  connection: 'keep-alive',
  'keep-alive': 'timeout=5',
  'transfer-encoding': 'chunked'
}

expected headers

Headers {
  vary: 'Origin',
  'content-type': 'text/html; charset=utf-8',
  date: 'Tue, 05 May 2026 04:30:46 GMT',
  connection: 'keep-alive',
  'keep-alive': 'timeout=5',
  'transfer-encoding': 'chunked'
}

Complete minimal reproducer

https://github.com/TanStack/router/commit/bcefc84d7e83fc4fd97e75ee4b95a7726f17f1f0 (head as of writing)

Steps to Reproduce the Bug

  1. cd e2e/react-start/hmr
  2. pnpm dev:rsbuild
  3. in a separate terminal, run node -e "let r = await fetch('http://localhost:3000'); import {inspect} from 'node:util'; console.log(inspect(await r.headers));"
  4. notice that the headers are malformed
  5. stop the rsbuild dev server
  6. pnpm dev:vite
  7. in a separate terminal, run node -e "let r = await fetch('http://localhost:3000'); import {inspect} from 'node:util'; console.log(inspect(await r.headers));"
  8. notice that the headers are correct

Expected behavior

I expect the headers not to be malformed

Screenshots or Videos

No response

Platform

  • Router / Start Version: bcefc84d7e83fc4fd97e75ee4b95a7726f17f1f0
  • OS: Linux
  • Browser: tested with Chrome, Firefox, python requests, and node.js fetch

Additional context

I tested this with curl as well curl -i http://localhost:3000 and it showed the expected headers when every other method i tried (chrome, firefox, etc...) did not.

  1. Thanks for the report! This was an issue in Rsbuild’s gzip middleware, and it has been fixed in Rsbuild 2.0.5.

Sign in to join this conversation.