-
Notifications
You must be signed in to change notification settings - Fork 155
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
Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:111:27) Emitted 'error' event at: at Socket #61
Comments
I also encountered the same problem. Have you solved it ? |
I encountered the same error for the same reason:
There are line number differences and a module name difference but that is probably due to the time difference between the previous comments and mine. Testing for this error I found that closing the browser window, in both Chrome and Edge, does trip my "close" event handler, however, it immediately generates the above error as well even though my code is within a try/catch block. Firefox didn't generate a "close" or react in any way so because of that I had disallow the use of Firefox for this specific application. (It's a closed environment we can limit what is available to be used) I traced through the stack and found the line in the events.js module as well as the line in this module Connection.js. I had expected to see a fairly straightforward error handler in events.js but, unfortunately, what I did find was overly cryptic and I didn't have the time to waste try to figure out what it was doing. I dropped back to Connection.js and modified the following code: From this:
To this:
First of all, I don't understand why this ECONNRESET is NOT already being handled by now. They say the caller needs to handle with a try/catch code block, well my code already has that and it doesn't work. Closing the active web page by clicking on the "X" in the upper right hand corner of the window frame is a pretty standard User web interaction which should NOT be causing the nodejs web server apps to crash. This may not be the proper "fix" but in all our testing, prior to the change, there were no other issues with ECONNRESET so we made the decision to filter and ignore it in the localized app copy of Connection.js located in the app's node_modules directory and document the fix for a "next time". |
if not have listen 'error', when I colse page, server will down.
The text was updated successfully, but these errors were encountered: