Next.js Discord

Discord Forum

Nextjs Handler stuck

Answered
Polish posted this in #help-forum
Open in Discord
PolishOP
We have an endpoint with potentially large json. It only occurred recently with it stuck and not returning anything and crashing the client on timeout.

We are sure that there is pending data to be sent via res.status(200).json(data). Sometimes it gets stuck, sometimes it sends a response. However when we use other 2xx status code, we receive a response right away (faster in fact).

What can cause this? Any solutions?

Next: 12.1.6

Edit: Codebase is 2 years already and it only occurred just out of nowhere.
Answered by Polish
View full answer

9 Replies

PolishOP
Bump
Sample screenshot
Changing the response to 203 status
Saint Bernard
wow how's this remotely possible
have you considered sending the data in chunks using 200?
@Saint Bernard have you considered sending the data in chunks using 200?
PolishOP
Yes, but that would mean we'll potentially do that in all of our api handlers.
Saint Bernard
Yeah that's not good
PolishOP
Answer
PolishOP
Lmao