histoire-dev / histoire

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

Svelte 5 support #741

Open rgevrek opened 2 weeks ago

rgevrek commented 2 weeks ago

Describe the bug

When I try to create a simple story with Svelte 5 and Vite 5, I got following error:

Error while collecting story /path-to-project/Component.story.svelte:
TypeError: Class extends value undefined is not a constructor or null
    at /path-to-project/node_modules/.pnpm/@histoire+plugin-svelte@0.17.17_histoire@0.17.17_svelte@5.0.0-next.1_vite@5.0.3/node_modules/@histoire/plugin-svelte/dist/collect/Story.svelte.js:87:17
    at async ViteNodeRunner.runModule (file:///path-to-project/node_modules/.pnpm/vite-node@0.34.7/node_modules/vite-node/dist/client.mjs:342:5)
    at async ViteNodeRunner.directRequest (file:///path-to-project/node_modules/.pnpm/vite-node@0.34.7/node_modules/vite-node/dist/client.mjs:326:5)
    at async ViteNodeRunner.cachedRequest (file:///path-to-project/node_modules/.pnpm/vite-node@0.34.7/node_modules/vite-node/dist/client.mjs:189:14)
    at async ViteNodeRunner.dependencyRequest (file:///path-to-project/node_modules/.pnpm/vite-node@0.34.7/node_modules/vite-node/dist/client.mjs:223:12)
    at async /path-to-project/node_modules/.pnpm/@histoire+plugin-svelte@0.17.17_histoire@0.17.17_svelte@5.0.0-next.1_vite@5.0.3/node_modules/@histoire/plugin-svelte/dist/collect/index.js:4:31
    at async ViteNodeRunner.runModule (file:///path-to-projectnode_modules/.pnpm/vite-node@0.34.7/node_modules/vite-node/dist/client.mjs:342:5)
    at async ViteNodeRunner.directRequest (file:///path-to-project/node_modules/.pnpm/vite-node@0.34.7/node_modules/vite-node/dist/client.mjs:326:5)
    at async ViteNodeRunner.cachedRequest (file:///path-to-projectnode_modules/.pnpm/vite-node@0.34.7/node_modules/vite-node/dist/client.mjs:189:14)
    at async ViteNodeRunner.dependencyRequest (file:///path-to-project/node_modules/.pnpm/vite-node@0.34.7/node_modules/vite-node/dist/client.mjs:223:12)

Reproduction

Reproduction in Stackblitz

System Info

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Pro
    Memory: 701.53 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.6.1 - /opt/homebrew/bin/node
    npm: 10.2.4 - /opt/homebrew/bin/npm
    pnpm: 8.6.6 - /opt/homebrew/bin/pnpm
    bun: 0.1.11 - ~/.bun/bin/bun
  npmPackages:
    @histoire/plugin-svelte: ^0.17.17 => 0.17.17 
    histoire: ^0.17.17 => 0.17.17 
    vite: ^5.0.3 => 5.0.3

Used Package Manager

pnpm

Validations

stackblitz[bot] commented 2 weeks ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.