Replies: 3 comments 10 replies
-
|
How's the backend deployed? It might just be that it is deployed as a serverless backend, and the socket dies out after a timeout time. |
Beta Was this translation helpful? Give feedback.
-
|
thank you for your answer @icyJoseph I simply deployed via vercel by making new project. my backend is in a separate repository. Is there something to check on the backend specifically? |
Beta Was this translation helpful? Give feedback.
-
|
Vercel serverless functions are not meant to hold long-lived WebSockets. Each invocation spins up, handles a request, and exits, so a Socket.IO server on the same deployment will drop or behave oddly under load. Common fixes:
If you need rooms + history + reconnect without a socket VM, (2) is what I'd pick. What are you building, chat threads or fire-and-forget alerts? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
hello, I have a problem, I deployed my backend (nodejs) and my frontend (next/react) on vercel, no worries, the problem is that the websocket part (socket.io) does not work and I do not understand why because it works very well in localhost.
Thank you very much for your help. attached my console error.
cyril
Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions