Next.js Discord

Discord Forum

Websocket events getting emitted twice

Unanswered
Southern African anchovy posted this in #help-forum
Open in Discord
Avatar
Southern African anchovyOP
This issue is driving me like crazyy . I have next js frontend app which I have a Next.js frontend application where I connect to a WebSocket and listen to events. I emit an event whenever the connection to the socket is established. However, my backend responds to this event twice because two connections are being made. Initially, I thought this was due to React's reactive nature, but after testing it in production, the same issue persists, confirming that it's not React-specific. Also i tried disabling strictMode but that doesn't works too.
Image

0 Replies