-
Notifications
You must be signed in to change notification settings - Fork 7
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: Uncaught (in promise) Http: connection closed before message completed #100
Comments
It also happens a lot when returning a server sent event. |
This issue is very blocking as it causes the server to completely crash @gr7d I believe we should handle the error at this line : https://github.com/gr7d/aqua/blob/main/shared.ts#L57C20-L57C20 |
I'm currently trying to reproduce it. If you have any tips, I'd be thankful. |
I can confirm adding a .catch() on the line I mentioned fixed the issue.
To create a reproduction code (with aqua v1), you may try this : app.get("/progress", (req) => {
let interval: number;
const stream = new ReadableStream({
start(controller) {
interval = setInterval(() => {
const val = `data: ${new Date().toISOString()}\r\n\r\n`;
controller.enqueue(new TextEncoder().encode(val));
}, 300);
},
cancel() {
clearInterval(interval);
}
});
return {
content: stream,
headers: {
"Content-Type": "text/event-stream"
}
};
}); Then, create an HTML page to subscribe to the event source using the Reload multiple times the page and you might get the error I described. |
Fix (#101) included in release v1.3.6. Thanks for your patience :) |
Thank you too for maintaining this lib, it is very simple, and I'm using it in many projects ! |
Sometimes, the following error appears randomly when I do a request :
Unfortunately, I don't have further information. I can't even reproduce sometimes.
The following github issue and linked threads might help : denoland/deno#13203
The text was updated successfully, but these errors were encountered: