How can I stop this error appearing in the console whenever I refresh the page and there is an active WebSocket connection?