#Gateway cutting connection between NestJs Backend and NextJS Frontend

3 messages · Page 1 of 1 (latest)

edgy geyser
#

Hello everyone! I'm working on a project that uses NestJS on the backend and NextJS on the frontend. In some situations, when the client sends a request to the backend, the response may take a little longer to be processed. The problem is that the gateway ends up closing the connection with the frontend before receiving the complete response, causing the user to see an error screen, while the backend continues to run normally.

I would like to know if anyone has faced a similar problem and how they dealt with it. I'm looking for ideas or patterns that can help solve this situation, such as the use of middlewares, interceptors, or any other approach that ensures that the frontend receives updates on the processing status and, eventually, the final response, without the connection being interrupted.

I thank you in advance for any suggestions or experiences you can share!

pale forge
#

The problem is that the gateway ends up closing the connection
What gateway? What is the exact error you get on the client side?

edgy geyser
#

it is the internal gateway, and I get timeout error