csalmeida / inertia-rails-svelte-example

An example of Using Rails 7 with Svelte 5
https://inertia-rails.netlify.app/guide/
11 stars 0 forks source link

Looks like inertia doesn't formally support Svelte 5 yet #1

Open scottwhudson opened 2 weeks ago

scottwhudson commented 2 weeks ago

I ran into a dependency resolution conflict when running npm install:

 inertia-rails-svelte-example  npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @inertiajs/svelte@1.2.0
npm ERR! Found: svelte@5.0.0-next.166
npm ERR! node_modules/svelte
npm ERR!   dev svelte@"^5.0.0-next.166" from the root project
npm ERR!   peer svelte@"^4.0.0 || ^5.0.0-next.0" from @sveltejs/vite-plugin-svelte@3.1.1
npm ERR!   node_modules/@sveltejs/vite-plugin-svelte
npm ERR!     @sveltejs/vite-plugin-svelte@"^3.1.1" from the root project
npm ERR!     peer @sveltejs/vite-plugin-svelte@"^3.0.0" from @sveltejs/vite-plugin-svelte-inspector@2.1.0
npm ERR!     node_modules/@sveltejs/vite-plugin-svelte-inspector
npm ERR!       @sveltejs/vite-plugin-svelte-inspector@"^2.1.0" from @sveltejs/vite-plugin-svelte@3.1.1
npm ERR!   1 more (@sveltejs/vite-plugin-svelte-inspector)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer svelte@"^3.20.0 || ^4.0.0" from @inertiajs/svelte@1.2.0
npm ERR! node_modules/@inertiajs/svelte
npm ERR!   @inertiajs/svelte@"^1.2.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: svelte@4.2.18
npm ERR! node_modules/svelte
npm ERR!   peer svelte@"^3.20.0 || ^4.0.0" from @inertiajs/svelte@1.2.0
npm ERR!   node_modules/@inertiajs/svelte
npm ERR!     @inertiajs/svelte@"^1.2.0" 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.

inertia/svelte appears to be pinned up to 4.0. I'd patch this myself but peeking at the svelte repo, it looks like a clean 5.0 release hasn't been cut yet.

csalmeida commented 2 weeks ago

Hi @scottwhudson, thank you for taking the time to highlight this.

That's correct, Inertia doesn't really support Svelte 5 and that version of Svelte is still under development.

My initial thoughts when creating this repo was to see how much work would it be to make it functional with version 5.

However, maybe it would be nice to leave it at version 4 so that it's more useful to everyone and keep the v5 experiment in a separate branch perhaps?