-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Bun prevents connection closure #58
Comments
Hello @apeman76 , I think you're experiencing an issue with Bun itself or SvelteKit, I'm not exactly sure which one it is. It looks like the This can be either because SvelteKit doesn't trigger it, or because Bun's got some implementation issues. I'm more inclined to say it's because of Bun itself, because it does work fine using NodeJs. Note well, now it does, after patch 0.13.9 The issue is this part here sveltekit-sse/src/lib/produce.js Lines 112 to 114 in 498ec1c
it doesn't seem to trigger under Bun whenever the stream is consumed. Here's a reproduction https://github.com/razshare/sveltekit-sse-issue-58 The code is not obfuscated with typescript stuff, so you can check the problem yourself by throwing in a console.log in there (see video below) I think you might have better luck opening an issue in https://github.com/oven-sh/bun I'll try look into it more next week and possibly open an issue there myself explaining the situation. If you get around to open an issue on their tracker before I do, please link back to this issue, so that I can see it referenced here and avoid creating duplicate issues, I'll do the same. I'll leave this open for now. |
There's also this issue opened in kit sveltejs/kit#11751 (comment) Though I don't think it's relevant anymore, because it works fine in NodeJs, it's just bun that doesn't work, and since bun promisses NodeJs compatibility it should be seen as a bun issue (I think). |
Im not sure what version of bun i'm on. It might be a few weeks old, then oven-sh/bun#6758 (comment) might have fixed it. Will report back when I have the chance to be on PC /edit |
I Assume the immediate workaround is just to not use bun? I.e.
|
Hello @SaintPepsi , yes, that is correct. |
Hello,
Thanks for this library. I have been using it since atleast 0.3.7, but have not been active for a while.
Im back now and am using the most recent version, I noticed that with
bun --bun run dev
my connection closure function never gets called, but if I run it with node (bun run dev
) it does get called.I have no idea how to fix this, do you have any idea?
Im pretty much using the cleanup example now and it has this issue aswell: https://github.com/razshare/sveltekit-sse?tab=readme-ov-file#cleanup
The text was updated successfully, but these errors were encountered: