vercel / next.js

The React Framework
https://nextjs.org
MIT License
123.21k stars 26.31k forks source link

fastapi streaming response is not decoded in chunks with compression enabled #62201

Open HP2706 opened 5 months ago

HP2706 commented 5 months ago

Link to the code that reproduces this issue

https://github.com/HP2706/nextjs_streaming_bug

To Reproduce

to reproduce run npm run dev from root of the project preferably use an virtual environment with Python 3.9.18

next click on the "stream" button about 10 seconds later the number 1 .. 10 will appear on the screen next to next.config.mjs and uncomment compression : false now reload and click again. this time the numbers will actually be stream as expected from the fastapi endpoint

Current vs. Expected behavior

i would expect the client to receive the streamingResponse from fastapi in chunks and not all at once even even without explicitly disabling compression

Provide environment information

Node : v21.5.0
os : darwin 23.2.0
Python : 3.9.18
fastapi : 0.100.1
uvicorn :0.23.2

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed)

Additional context

No response

lchenneberg commented 1 month ago

Same issue on my side

Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote šŸ‘ on the issue description or subscribe to the issue for updates. Thanks!

seplee commented 5 days ago

Same issue plz fix

Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote šŸ‘ on the issue description or subscribe to the issue for updates. Thanks!