Skip to content

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

Closed

Description

@sadan4

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

bcefc84 (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: bcefc84
  • 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.

Activity

  1. chenjiahan commented on May 7, 2026

    @chenjiahan
    Contributor

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

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