Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:49 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6020
Available memory (MB): 16384
Available CPU cores: 10
Binaries:
Node: 20.9.0
npm: 10.1.0
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 14.2.4 // Latest available version is detected (14.2.4).
eslint-config-next: 14.2.4
react: 18.3.1
react-dom: 18.3.1
typescript: 5.4.5
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Developer Experience, Pages Router
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
In my actual application where I ran into this I actually do get 10 bytes in the response, but its always 10 bytes regardless of how much data is written to the response.
Link to the code that reproduces this issue
https://github.com/togakangaroo/nextjs-stream-compression?tab=readme-ov-file
To Reproduce
See this repo with a full writeup in the README file.
Essentially this pattern within a pages api handler returns 0 bytes
Current vs. Expected behavior
This is the correct way of streaming compressed content to a response. The following works fine (example included in repo as well)
Provide environment information
Which area(s) are affected? (Select all that apply)
Developer Experience, Pages Router
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
In my actual application where I ran into this I actually do get 10 bytes in the response, but its always 10 bytes regardless of how much data is written to the response.