razshare / sveltekit-sse

Server Sent Events with SvelteKit
https://www.npmjs.com/package/sveltekit-sse
MIT License
271 stars 9 forks source link

Svelte 5 RC #42

Closed JonathonRP closed 4 months ago

JonathonRP commented 4 months ago

all to do is update to use Svelte 5, and update minor version and add 5/5.next- for peer dependencies and supported version.

razshare commented 4 months ago

Hello @JonathonRP ,

Peer dependencies are updated and the new 0.12.4 version supports Svelte 5 and future releases.

Please let me know if this addresses your issue.

thiagomagro commented 4 months ago

Still failing to install when using Svelte 5.

npm error peer svelte@"^4.0.0 || ^5.0.0-next.0" from @sveltejs/kit@2.5.7

Maybe because Svelte is at 5.0.0-next.123?

razshare commented 4 months ago

Hello @thiagomagro , That might be it, but I can't know for sure because I don't know what peer dependencies and versions you're running. As far as I can tell creating a new kit project with Svelte 5 and adding this library as a dependency seems to work fine. If you can upload a repository reproducing your error I can take a loot at it specifically.

thiagomagro commented 4 months ago

To reproduce, just create a new Sveltekit project npm create svelte@latest my-app (make sure to mark the option to use Svelte5) run npm install inside my-app folder and try to install npm i -D sveltekit-sse

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: my-app@0.0.1 npm ERR! Found: svelte@5.0.0-next.125 npm ERR! node_modules/svelte npm ERR! dev svelte@"^5.0.0-next.1" from the root project npm ERR! peer svelte@"^4.0.0 || ^5.0.0-next.0" from @sveltejs/kit@2.5.7 npm ERR! node_modules/@sveltejs/kit npm ERR! dev @sveltejs/kit@"^2.0.0" from the root project npm ERR! peer @sveltejs/kit@">=1.0.0" from sveltekit-sse@0.12.4 npm ERR! node_modules/sveltekit-sse npm ERR! dev sveltekit-sse@"*" from the root project npm ERR! 1 more (@sveltejs/vite-plugin-svelte) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer svelte@">=3.0.0" from sveltekit-sse@0.12.4 npm ERR! node_modules/sveltekit-sse npm ERR! dev sveltekit-sse@"*" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR!

razshare commented 4 months ago

Hello @thiagomagro , I think we found a bug in Bun, its npm version rules seem to be a bit too relaxed because the whole process works just fine in Bun.

But it shouldn't after reading your error: SvelteKit 2 doesn't seem to support Svelte 3 anymore, which is why you're getting that error using npm, because this library's v0.12.4 declares these peer dependencies

"svelte": "^4.0.0 || ^5.0.0-next.0"

Please update to version 0.12.6 or try again the whole process from scratch, it should work fine with npm now.

thiagomagro commented 4 months ago

Thank you @tncrazvan ! Its working now, you can close this. Congrats on the library, Im following from close now!