Closed luccas40 closed 1 year ago
Hey @luccas40 , I ran your code and it works correctly for me.
I ran it with both bun 1.0.7
and node v18.17.1
and it works correctly.
I just published a repo and the code here https://github.com/tncrazvan/sveltekit-sse-issue-12
Can you please clone it, try to run it and let me know if it works on your end?
Also, can you create a repo of your own reproducing your issue and post it here?
Just cloned your repo, installed the packages and It is still doing the same behavior
~/sveltekit-sse-issue-12$ bun run --bun dev --host
$ vite dev --host
▲ [WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]
jsconfig.json:2:12:
2 │ "extends": "./.svelte-kit/tsconfig.json",
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Forced re-optimization of dependencies
VITE v4.5.0 ready in 991 ms
➜ Local: http://localhost:5173/
➜ Network: http://192.168.15.100:5173/
➜ press h to show help
5:06:24 PM [vite] ✨ new dependencies optimized: sveltekit-sse
5:06:24 PM [vite] ✨ optimized dependencies changed. reloading
0.8399509345285102
0.8112408000210155
0.8399509345285102
0.8112408000210155
0.8399509345285102
0.8112408000210155
0.8399509345285102
0.8112408000210155
0.8399509345285102
0.8112408000210155
0.8399509345285102
0.8112408000210155
0.8399509345285102
0.8112408000210155
0.8399509345285102
Okay, running with node apparently fixed the problem. Seems like is some weird interaction with Bun Btw it needs to force to run with bun "--bun" or else it tries to run with node for some reason
Maybe you're using an older version of bun? They do seem to publish a new release almost every week fixing more and more bugs.
Btw it needs to force to run with bun "--bun" or else it tries to run with node for some reason
Bun this is actually weird though.
Can you run bun upgrade
and see if it works after the upgrade?
Otherwise we should let the bun guys know about this.
I'm already on the latest version 1.0.7
hello @luccas40 , I'm closing this issue since it doesn't seem to be related to the library itself. If you have more information that says otherwise I'll reopen it.
Meanwhile, if it really turns out to be a Bun issue, maybe you should open an issue on https://github.com/oven-sh/bun and let them know your hardware specs and os setup.
Code is having the same behavior commented on the issue #6 , It's maintaining the connection even if I close the page. Reload page and now I have 2 loops. I tried the solution mentioned there but the function onCancel is never called. Here is my API GET function:
And this is my output:
Again the console log "closed" never shows up. I also have SSR disabled on the page consuming the API. I might be missing something cause I'm new to svelte.