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

vite 4 support with new sveltekit versions #397

Closed
4 tasks done
hexagon6 opened this issue Dec 13, 2022 · 1 comment
Closed
4 tasks done

vite 4 support with new sveltekit versions #397

hexagon6 opened this issue Dec 13, 2022 · 1 comment
Labels
enhancement: to triage New feature of request pending review by team member

Comments

@hexagon6
Copy link
Contributor

Clear and concise description of the problem

When trying to install newer versions of @sveltejs/kit I receive the following errors:

Conflicting peer dependency: vite@3.2.5

$ npm i @sveltejs/kit@next
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: histoire@0.11.9
npm ERR! Found: vite@4.0.1
npm ERR! node_modules/vite
npm ERR!   dev vite@"^4.0.1" from the root project
npm ERR!   peer vite@"^4.0.0" from @sveltejs/kit@1.0.0-next.584
npm ERR!   node_modules/@sveltejs/kit
npm ERR!     dev @sveltejs/kit@"1.0.0-next.584" from the root project
npm ERR!   2 more (@sveltejs/vite-plugin-svelte, vitefu)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^2.9.0 || ^3.0.0" from histoire@0.11.9
npm ERR! node_modules/histoire
npm ERR!   peer histoire@"^0.11.9" from @histoire/plugin-svelte@0.11.9
npm ERR!   node_modules/@histoire/plugin-svelte
npm ERR!     dev @histoire/plugin-svelte@"^0.11.9" from the root project
npm ERR!   dev histoire@"^0.11.9" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: vite@3.2.5
npm ERR! node_modules/vite
npm ERR!   peer vite@"^2.9.0 || ^3.0.0" from histoire@0.11.9
npm ERR!   node_modules/histoire
npm ERR!     peer histoire@"^0.11.9" from @histoire/plugin-svelte@0.11.9
npm ERR!     node_modules/@histoire/plugin-svelte
npm ERR!       dev @histoire/plugin-svelte@"^0.11.9" from the root project
npm ERR!     dev histoire@"^0.11.9" 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! /home/user/.npm/_logs/2022-12-13T10_41_25_581Z-eresolve-report.txt

Suggested solution

This looks like a limitation on peerDependencies of vite versions to 2 and 3, but not 4.

Assuming this is the only part missing updating the peerDependencies to include "vite": "^4".

Changing package.json of histoire@0.11.9:

Change from

  "peerDependencies": {
    "vite": "^2.9.0 || ^3.0.0"
  },

Change to

  "peerDependencies": {
    "vite": "^2.9.0 || ^3.0.0 || ^4.0.0"
  },

Or similar might resolve the npm install issue.

I have tested my stories with vite 4 and it seems to work with this version.

Alternative

Staying on @sveltejs/kit@1.0.0-next.573 and vite 3 works.

Additional context

Using @sveltejs/kit@1.0.0-next.573 and trying to upgrading to more recent versions fail due to histoire dependency not allowing it.

Validations

@hexagon6 hexagon6 added the enhancement: to triage New feature of request pending review by team member label Dec 13, 2022
Akryum added a commit that referenced this issue Dec 19, 2022
…392, #397) (#402)

Co-authored-by: Guillaume Chau <guillaume.b.chau@gmail.com>
@Akryum Akryum closed this as completed Dec 19, 2022
@hexagon6
Copy link
Contributor Author

hexagon6 commented Dec 24, 2022

Thanks very much @Akryum ! I enjoy working with histoire! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement: to triage New feature of request pending review by team member
Projects
None yet
Development

No branches or pull requests

2 participants