“websocket was interrupted while page is loading” on Firefox for Socket.io

前端 未结 6 1835
不知归路
不知归路 2020-12-07 13:19
Error: The connection to  was interrupted while the page was loading.
Source File: localhost/socket.io/node_modules/socket.io-client/dist/socket.io.         


        
6条回答
  •  庸人自扰
    2020-12-07 14:06

    What impact does this have on your application? My guess is that it's just not great to see an error in the console.

    The problem here is that you are seeing Firefox loggin this error and there's nothing you can do about it. It's not possible to capture this error with a try...catch block or via websocket.onerror/websocket.onclose.

    See: How do I catch a WebSocket connection interruption?

    Related:

    • Should WebSocket.onclose be triggered by user navigation or refresh?
    • Firefox - Race condition allows ghost WebSocket connections to live after tab closed

提交回复
热议问题