Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Unable to use nhooyr/websocket in WASM running in Node.js: nhooyr/websocket should process 'error' event #400

Closed
Labels
Milestone
@sza-1

Description

@sza-1

Probablywebsocket#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 onEventEmitter, 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 ofwebsocket#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp