histoire-dev / histoire-dev/histoire
Svelte 5 support
- Dominant language
- TypeScript
- Stars
- 3.6k
- Forks
- 212
- PR merge metrics
- No merged PRs in 30d
Description
### 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](https://stackblitz.com/edit/histoire-svelte3-starter-a9yfnh?file=package.json)
### System Info
```shell
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
- [X] Follow our [Code of Conduct](https://github.com/histoire-dev/histoire/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/histoire-dev/histoire/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://histoire.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/histoire-dev/histoire/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/histoire-dev/histoire/discussions).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
Contributor guide
Research direction
Start with the linked Stackblitz reproduction and the package.json versions for Svelte 5 and Vite 5. Trace the collection failure from @histoire/plugin-svelte/dist/collect/Story.svelte.js and collect/index.js. Done means a simple Svelte 5 story is collected without the Class extends value undefined error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vite
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100