sveltejs / kit

web development, streamlined
https://kit.svelte.dev
MIT License
18.43k stars 1.88k forks source link

Error resolving eslint-plugin-svelte@2.35.1 while using svelte5-alpha via the create CLI #11530

Closed akash-joshi closed 8 months ago

akash-joshi commented 8 months ago

Describe the bug

I went through the sveltekit create command, npm create svelte@latest, using the sveltekit default app and installing all optional dependencies via CLI - prettier, eslint, svelte-5, etc. After cding into the directory and running npm i, an overriding peer dependency error pops up.

Reproduction

Root app - https://github.com/akash-joshi/art/tree/173f23f3cfe208c893e2e242d9fe5aff48f3fc32

Reproduction steps:

# install all optional dependencies
npm create svelte@latest my-app
cd my-app
npm install

Logs

npm i
npm WARN ERESOLVE overriding peer dependency
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: eslint-plugin-svelte@2.35.1
npm ERR! Found: svelte@5.0.0-next.29
npm ERR! node_modules/svelte
npm ERR!   peer svelte@"^3.19.0 || ^4.0.0" from svelte-hmr@0.15.3
npm ERR!   node_modules/@sveltejs/vite-plugin-svelte/node_modules/svelte-hmr
npm ERR!     svelte-hmr@"^0.15.3" from @sveltejs/vite-plugin-svelte@3.0.1
npm ERR!     node_modules/@sveltejs/vite-plugin-svelte
npm ERR!       dev @sveltejs/vite-plugin-svelte@"^3.0.0" from the root project
npm ERR!       2 more (@sveltejs/kit, @sveltejs/vite-plugin-svelte-inspector)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peerOptional svelte@"^3.37.0 || ^4.0.0" from eslint-plugin-svelte@2.35.1
npm ERR! node_modules/eslint-plugin-svelte
npm ERR!   dev eslint-plugin-svelte@"^2.35.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: svelte@4.2.8
npm ERR! node_modules/svelte
npm ERR!   peerOptional svelte@"^3.37.0 || ^4.0.0" from eslint-plugin-svelte@2.35.1
npm ERR!   node_modules/eslint-plugin-svelte
npm ERR!     dev eslint-plugin-svelte@"^2.35.1" 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! 
npm ERR! For a full report see:
npm ERR! /Users/akashjoshi/.npm/_logs/2024-01-06T13_05_51_731Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /Users/akashjoshi/.npm/_logs/2024-01-06T13_05_51_731Z-debug-0.log

System Info

System:
    OS: macOS 13.4.1
    CPU: (8) arm64 Apple M1
    Memory: 92.38 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.0 - /usr/local/bin/node
    npm: 9.6.7 - /usr/local/bin/npm
  Browsers:
    Brave Browser: 115.1.56.14
    Safari: 16.5.2


### Severity

annoyance

### Additional Information

_No response_
ghostdevv commented 8 months ago

If you bump to eslint-plugin-svelte@2.36.0-next.3 it will fix that warning as it has experimental svelte 5 support.

Not sure if we wanna set that as the default in the create-svelte template or not

benmccann commented 8 months ago

We can use the -next version for users who select Svelte 5 and keep the stable version for users on Svelte 4

zyrain commented 7 months ago

Doing this is still showing the vite unmet peer warning:

└─┬ @sveltejs/vite-plugin-svelte 3.0.1 └─┬ svelte-hmr 0.15.3 └── ✕ unmet peer svelte@"^3.19.0 || ^4.0.0": found 5.0.0-next.38

Can that be safely ignored?