#8544·router

Start + Rsbuild: plugin forces `server.compress: false`, overriding user config

Author: gleknerCreated Sep 28, 2026Updated Sep 29, 2026

The Rsbuild plugin merges server.compress: false over the user config, so dev responses are never gzipped, even with compress: true.

Repro

typescript
// rsbuild.config.ts
export default defineConfig({
  server: { compress: true },
  plugins: [pluginReact(), tanstackStart()],
})

Run rsbuild dev, then curl -sI -H 'Accept-Encoding: gzip' localhost:3000/assets/js/index.js.

Expected

Content-Encoding: gzip (Rsbuild's default, and set explicitly here).

Actual

No encoding. The dev index.js of a minimal app is 1.9 MB instead of 432 kB.

Possible fix

The override (plugin.ts#L253-L255) came from #7348 for #7344. Rsbuild fixed that bug in 2.0.5 (web-infra-dev/rsbuild#7613). With the override removed on 2.2.10, SSR headers are correct. Streamed responses are still buffered until the stream ends, because srvx's sendNodeResponse never calls res.flush(). Rsbuild's gzip middleware added res.flush() in 2.2.10 (web-infra-dev/rsbuild#8533). In my test, calling res.flush?.() after each res.write in the SSR middleware (server-middleware.ts#L151) fixed the buffering. #8137 still keeps the override.

Workaround

Add api.modifyRsbuildConfig({ order: 'post', handler: (c) => { c.server = { ...c.server, compress: true } } }). Streamed responses then arrive in one piece at the end.

Versions

@tanstack/react-start 1.168.59 (start-plugin-core 1.171.48, same on main at 41ebd28), @rsbuild/core 2.2.10, Node 24.16.