-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Improve websocket error handling and fix #315 #320
Improve websocket error handling and fix #315 #320
Conversation
Add new improvements
Add all new commits
new features
@DeMoorJasper Does this fix the issue where Parcel crashes on refreshing the page? (using parcel-plugin-vue) |
@FalkoJoseph Yup it does |
@DeMoorJasper Nice, can't wait! Also cool to see a Howest student contributing to this project 👍 |
@devongovett could we get this PR approved and released as a bugfix, lot's of people are being affected with clean install #315 |
return; | ||
} | ||
// TODO: Use logger to print errors | ||
console.log(prettyError(err)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you seen any other errors actually happen? should we just ignore them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just for future error handling.
Normally ECONNRESET is the only error that accures due to chrome not properly closing the connection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other errors might be parser errors, like an invalid frame, an inflate error if you use permessage-deflate, a frame with a payload bigger than the maxPayload
option or other net.Socket
errors like write EPIPE, write ECONNABORTED, etc.
Published in v1.2.1. |
if (this.unresolvedError) { | ||
ws.send(JSON.stringify(this.unresolvedError)); | ||
} | ||
}); | ||
|
||
this.wss.on('error', this.handleSocketError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably not needed as it adds the listener after the server is bound. errors are forwarded from the internal http.Server
and most of them (all?) are emitted when listening.
Logs errors accuring while sending data instead of throwing them as unhandled errors.
Also added an ignore to ECONNRESET, because this gets triggered every time html reload is triggered.
Closes #315
TODO:
Fix hmr related tests[DONE]