-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Silent NodeJS process termination when missing ws.on('error') handler #2143
Comments
It seems to be related to nodejs/node#47822 because it doesn't reproduce with NodeJS v18.16.0. |
I can't reproduce.
|
Nvm, my bad, sorry. |
@dilame Would you mind updating how you fixed this? Am facing exactly the same issue. |
In short, you just need to downgrade NodeJS version 18. I have not found a way to directly fix it yet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Description
When the error handler for
ws.on('error')
is not implemented, and an error takes place, the NodeJS process terminates without any warnings or error messages. It took a considerable amount of time and effort to identify the issue, which was eventually discovered after adding the following line of code:ws.on('error', (e) => console.error(e));
. Consequently, the error message below was produced:ws version
8.12.0
Node.js Version
v20.1.0
System
System:
OS: macOS 13.3.1
CPU: (10) arm64 Apple M1 Pro
Memory: 98.66 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Expected result
Unhandled exception throw, or any other indicator what and where gone wrong
Actual result
In the absence of the
ws.on('error')
handler, the NodeJS process terminates silently without providing any error messages or warnings when an error takes place within the WebSocket connection.Attachments
No response
The text was updated successfully, but these errors were encountered: