histoire-dev / histoire

⚡ Fast and beautiful interactive component playgrounds, powered by Vite
https://histoire.dev
MIT License
3.2k stars 191 forks source link

@histoire/plugin-svelte: Peer Dependency "svelte": "^3.0.0" prevents installation of svelte 4 #551

Closed hexagon6 closed 1 year ago

hexagon6 commented 1 year ago

Describe the bug

When migrating from svelte 3 to svelte 4 in a sveltekit project which uses histoire, I get the following error on npm install.

$ npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @histoire/plugin-svelte@0.16.1
npm ERR! Found: svelte@4.0.0
npm ERR! node_modules/svelte
npm ERR!   dev svelte@"^4.0.0" from the root project
npm ERR!   peer svelte@"^3.54.0 || ^4.0.0-next.0" from @sveltejs/kit@1.20.4
npm ERR!   node_modules/@sveltejs/kit
npm ERR!     dev @sveltejs/kit@"^1.20.4" from the root project
npm ERR!     peer @sveltejs/kit@"^1.0.0" from @sveltejs/adapter-auto@2.1.0
npm ERR!     node_modules/@sveltejs/adapter-auto
npm ERR!       dev @sveltejs/adapter-auto@"^2.0.0" from the root project
npm ERR!     1 more (@sveltejs/adapter-static)
npm ERR!   6 more (@sveltejs/vite-plugin-svelte, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer svelte@"^3.0.0" from @histoire/plugin-svelte@0.16.1
npm ERR! node_modules/@histoire/plugin-svelte
npm ERR!   dev @histoire/plugin-svelte@"^0.16.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: svelte@3.59.2
npm ERR! node_modules/svelte
npm ERR!   peer svelte@"^3.0.0" from @histoire/plugin-svelte@0.16.1
npm ERR!   node_modules/@histoire/plugin-svelte
npm ERR!     dev @histoire/plugin-svelte@"^0.16.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.

So my conclusion is: @histoire/plugin-svelte: Peer Dependency "svelte": "^3.0.0" prevents installation of svelte 4

Reproduction

Install sveltekit in version ^1.13.0 with svelte@3 with @histoire/plugin-svelte and then run npx svelte-migrate svelte-4 to migrate to svelte@4 and sveltekit to ^1.20.4.

This will lead to conflicting peer dependencies because of peer dependency definition of @histoire/plugin-svelte@0.16.1 .

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD Ryzen 7 PRO 5850U with Radeon Graphics
    Memory: 27.08 GB / 30.18 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.16.1 - ~/.nvm/versions/node/v18.16.1/bin/node
    npm: 9.7.2 - ~/.nvm/versions/node/v18.16.1/bin/npm
  Browsers:
    Brave Browser: 114.1.52.126
  npmPackages:
    @histoire/plugin-svelte: ^0.16.1 => 0.16.1 
    histoire: ^0.16.1 => 0.16.2 
    vite: ^4.2.1 => 4.3.9

Used Package Manager

npm

Validations

brittneypostma commented 1 year ago

Is there a timeline on supporting Svelte 4? I am looking into using Histoire over Storybook in a project that is starting soon, but this would be a blocker.

swyxio commented 1 year ago

@brittneypostma i believe it is supported, the version number bump is just overly restrictive. just force install