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#
cd e2e/react-start/hmr
pnpm dev:rsbuild
- 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));"
- notice that the headers are malformed
- stop the rsbuild dev server
pnpm dev:vite
- 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));"
- 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.
Thanks for the report! This was an issue in Rsbuild’s gzip middleware, and it has been fixed in Rsbuild 2.0.5.