You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Probably websocket#Conn.init should call c.ws.OnError to subscribe on and process WebSocket#error event.
The issue is the following:
https://github.com/websockets/ws is the most popular WebSocket implementation for the Node.js. It is based on EventEmitter, which throws an exception on any unhandled connection error. Actually it emits error event and then close event. If there is no event listener for error event, then EventEmitter throws an exception and Node.js crashes by default (this behaviour may be fixed with node:domain, but it is deprecated in Node.js 20.5.0). Writers of JavaScript code unable to add an error listener, since nhooyr/websocket creates WebSocket object internally, so it makes nhooyr/websocket pretty unusable in Node.js in case of invalid WSS URL or any transport error.
Probably adding of websocket#Conn.releaseOnClose and calling c.ws.OnError should fix the issue.
Found on Node.js 20.5.0, websockets/ws 8.13.0 and nhooyr/websocket 1.8.7.
The text was updated successfully, but these errors were encountered:
Probably
websocket#Conn.init
should callc.ws.OnError
to subscribe on and processWebSocket#error
event.The issue is the following:
https://github.com/websockets/ws is the most popular WebSocket implementation for the Node.js. It is based on
EventEmitter
, which throws an exception on any unhandled connection error. Actually it emitserror
event and thenclose
event. If there is no event listener forerror
event, thenEventEmitter
throws an exception and Node.js crashes by default (this behaviour may be fixed withnode:domain
, but it is deprecated in Node.js 20.5.0). Writers of JavaScript code unable to add an error listener, sincenhooyr/websocket
creates WebSocket object internally, so it makes nhooyr/websocket pretty unusable in Node.js in case of invalid WSS URL or any transport error.Probably adding of
websocket#Conn.releaseOnClose
and callingc.ws.OnError
should fix the issue.Found on Node.js 20.5.0, websockets/ws 8.13.0 and nhooyr/websocket 1.8.7.
The text was updated successfully, but these errors were encountered: