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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Support for svelte 5 #156

Open
Tracked by #2116
bhvngt opened this issue Nov 16, 2023 · 10 comments
Open
Tracked by #2116

[Bug] Support for svelte 5 #156

bhvngt opened this issue Nov 16, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@bhvngt
Copy link

bhvngt commented Nov 16, 2023

Describe the bug

When I try to run this plugin with svelte 5, it reports following error.

WARN 馃毃 Unable to index files:
[SB] WARN - ./src/lib/Button/Button.stories.svelte: Cannot read properties of undefined (reading 'instance')
[SB] WARN - ./src/lib/Image/Image.stories.svelte: Cannot read properties of undefined (reading 'instance')
[SB] WARN - ./src/lib/Counter/Counter.stories.svelte: Cannot read properties of undefined (reading 'instance')

Steps to reproduce the behavior

  1. Upgrade svelte to svelte@next
  2. run storybook
  3. See error

Expected behavior

It should work with svelte 5

Environment

  • OS: [e.g. iOS] OSX 14.0
  • Node.js version: [e.g. v12.17.0] 20.9
  • NPM version: [e.g. 6.14.4] pnpm 8.10.5
  • Browser (if applicable): [e.g. chrome, safari]: chrome
  • Browser version (if applicable): [e.g. 22]: 119

Additional context

Svelte 5 is cutting edge and is very new. So just filing this bug in case if it is a minor change to support it.

@bhvngt bhvngt added the bug Something isn't working label Nov 16, 2023
@j3rem1e
Copy link
Contributor

j3rem1e commented Nov 16, 2023

I'm not sure Storybook itself supports Svelte 5 馃檪

@bhvngt
Copy link
Author

bhvngt commented Nov 16, 2023

Svelte 5 is backward compatible with svelte 4. So I was trying to upgrade svelte without trying out any of the new svelte 5 syntax.

@JReinhold
Copy link
Collaborator

Here's the upstream issue: storybookjs/storybook#24886

(might not be the same problem though)

@JReinhold
Copy link
Collaborator

We've added preliminary Svelte 5 support in the Storybook 8 alphas, you could try upgrading to those and see if that fixes the issue. If it does I think we can close it.

npx storybook@next upgrade --prerelease

Based on the errors you've reported it looks like a Storybook core issue and not related to this addon.

@ryu-man
Copy link

ryu-man commented Jan 22, 2024

I got this error using storybook 8 with svelte 5 installed

Unable to index ./src/stories/Test.stories.svelte:
WARN   TypeError: Cannot read properties of undefined (reading 'instance')

@eunukasiko
Copy link

- ./src/lib/components/button/Button.stories.svelte: Cannot read properties of undefined (reading 'instance')

@bhvngt
Copy link
Author

bhvngt commented Mar 7, 2024

I tried this plugin on the latest 8.0.0-rc.2 release which supports svelte 5. I have used the latest 4.1.2 for my reproduction.

I am getting the same error as @eunukasiko.

Here's the link to the sandbox.

@RobinKnipe
Copy link

SB v8 now released. Would be great if Svelte5 were supported.

@bhvngt
Copy link
Author

bhvngt commented May 7, 2024

Since svelte 5 has reached release-candidate. Would this be a good time to add support for svelte 5?

This add-on makes story creation for svelte so much easier. So thanks a ton to all the contributors for creating this add-on. 馃憦馃憦馃憦

@xeho91
Copy link
Collaborator

xeho91 commented May 7, 2024

There's a work in progress #177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants