Skip to content
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

Update peerDependencies to prevent npm install conflicts #551

Open
yairkukielka opened this issue Apr 26, 2024 · 7 comments
Open

Update peerDependencies to prevent npm install conflicts #551

yairkukielka opened this issue Apr 26, 2024 · 7 comments

Comments

@yairkukielka
Copy link

Helllo! Would it be possible to update peerDependencies so we don't have to use the npm overrides field?

Using svelte 4 and vite 5 I'm getting these warnings when I run npm install:

           
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @sveltejs/[email protected]
npm WARN Found: [email protected]
npm WARN node_modules/vite
npm WARN   dev vite@"^5.2.10" from the root project
npm WARN   5 more (@roxi/routify, @sveltejs/vite-plugin-svelte, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer vite@"^4.0.0" from @sveltejs/[email protected]
npm WARN node_modules/@roxi/routify/node_modules/@sveltejs/vite-plugin-svelte
npm WARN   @sveltejs/vite-plugin-svelte@"^2.4.6" from @roxi/[email protected]
npm WARN   node_modules/@roxi/routify
npm WARN   1 more (@sveltejs/vite-plugin-svelte-inspector)
npm WARN 
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/vite
npm WARN   peer vite@"^4.0.0" from @sveltejs/[email protected]
npm WARN   node_modules/@roxi/routify/node_modules/@sveltejs/vite-plugin-svelte
npm WARN     @sveltejs/vite-plugin-svelte@"^2.4.6" from @roxi/[email protected]
npm WARN     node_modules/@roxi/routify
npm WARN     1 more (@sveltejs/vite-plugin-svelte-inspector)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @sveltejs/[email protected]
npm WARN Found: [email protected]
npm WARN node_modules/vite
npm WARN   dev vite@"^5.2.10" from the root project
npm WARN   5 more (@roxi/routify, @sveltejs/vite-plugin-svelte, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer vite@"^4.0.0" from @sveltejs/[email protected]
npm WARN node_modules/@roxi/routify/node_modules/@sveltejs/vite-plugin-svelte/node_modules/@sveltejs/vite-plugin-svelte-inspector
npm WARN   @sveltejs/vite-plugin-svelte-inspector@"^1.0.4" from @sveltejs/[email protected]
npm WARN 
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/vite
npm WARN   peer vite@"^4.0.0" from @sveltejs/[email protected]
npm WARN   node_modules/@roxi/routify/node_modules/@sveltejs/vite-plugin-svelte/node_modules/@sveltejs/vite-plugin-svelte-inspector
npm WARN     @sveltejs/vite-plugin-svelte-inspector@"^1.0.4" from @sveltejs/[email protected]

I needed to add this section to my package.json to make npm happy:

        "@sveltejs/vite-plugin-svelte": "$@sveltejs/vite-plugin-svelte",
        "@roxi/routify": {
            ".": "$@roxi/routify",
            "vite": "$vite",
            "svelte": "$svelte"
        }

Also, in package.json I use "@sveltejs/vite-plugin-svelte": "^3.1.0", because it's imported by vite 5.

How to fix

I think if we add this to the "peerDepenencies" field in routify package.json it would get resolved:

    "peerDependencies": {
        "vite": "4 || 5",
        "svelte": ">=4",
        "@sveltejs/vite-plugin-svelte": ">=2"
    },
@jakobrosenberg
Copy link
Member

Hi @yairkukielka , thanks for sharing this. Is this issue related to R2 or R3?

@yairkukielka
Copy link
Author

R3

@yairkukielka
Copy link
Author

Actually, we should probably just do

"peerDependencies": {
        "vite": "4 || 5",
        "svelte": "3 || 4",
        "@sveltejs/vite-plugin-svelte": ">=2"
    },

Since this package doesn't seem to work with Svelte 5 yet

@jakobrosenberg
Copy link
Member

jakobrosenberg commented May 16, 2024

So far I'm only aware of one issue with Svelte 5. I don't know if it's a bug, but when passing data through <slot mydata="hello world" /> the passed mydata seems to be an empty store if nothing is passed.

I have a small fix for it, but it needs further investigation.

EDIT, this issue affects Routify itself and not just Routify projects as Routify uses slot properties internally.

@yairkukielka
Copy link
Author

yairkukielka commented May 17, 2024

Hi, I added a separate issue for Svelte 5 support: #554

@kefahi
Copy link

kefahi commented Oct 24, 2024

Hello @jakobrosenberg
Were you able to push that fix?
Given that Svelte 5 was released recently, are there any remaining blockers from using roufity 3 with svelete 5?
Thanks!

@jakobrosenberg
Copy link
Member

@kefahi sorry about the slow reply.

The only blocker now is SSR/SSG. If you don't need server rendering, I'm not aware of any bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants