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

[Bug] addon-svelte-csf v3 and storybook v7 not working together #91

Closed
vekunz opened this issue Jan 23, 2023 · 2 comments
Closed

[Bug] addon-svelte-csf v3 and storybook v7 not working together #91

vekunz opened this issue Jan 23, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@vekunz
Copy link

vekunz commented Jan 23, 2023

Describe the bug

Hi, I tried to use this plugin in version 3.0.0-next.3 together with storybook 7.0.0-beta.31. But it seems that they are currently not compatible.

First, after trying to show a *.stories.svelte Story in the browser, it showed the error Failed to fetch dynamically imported module: http://localhost:6006/src/stories/Button_csf.stories.svelte. In the server console, it reported a missing dependency @storybook/client-api.

After I run npm i -D @storybook/client-api@next manually and restarted the server, it showed another error in the browser console:

react.development.js:209 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

Check the render method of `Docs`.
    at Docs (http://localhost:6006/node_modules/.cache/.vite-storybook/deps/chunk-ZYQXF3GY.js?v=28e0d039:1524:15)
    at MDXProvider (http://localhost:6006/node_modules/.cache/.vite-storybook/deps/chunk-WA3OJM76.js?v=28e0d039:28:24)


Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

Check the render method of `Docs`.
    at createFiberFromTypeAndProps (react-dom.development.js:28439:17)
    at createFiberFromElement (react-dom.development.js:28465:15)
    at reconcileSingleElement (react-dom.development.js:15750:23)
    at reconcileChildFibers2 (react-dom.development.js:15808:35)
    at reconcileChildren (react-dom.development.js:19167:28)
    at updateHostComponent (react-dom.development.js:19924:3)
    at beginWork (react-dom.development.js:21618:14)
    at HTMLUnknownElement.callCallback2 (react-dom.development.js:4164:14)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:16)
    at invokeGuardedCallback (react-dom.development.js:4277:31)

Steps to reproduce the behavior

I created a reproduction repo https://github.com/vekunz/storybook-v7-svelte-csf.

Expected behavior

It just should show the Svelte-Stories, like in Storybook v6.

Environment

  • OS: Windows 10
  • Node.js version: v16.19.0
  • NPM version: 8.13.2
  • Browser (if applicable): Chrome
  • Browser version (if applicable): 109
  • Device (if applicable): Laptop
@vekunz vekunz added the bug Something isn't working label Jan 23, 2023
@JReinhold JReinhold self-assigned this Feb 10, 2023
@shilman
Copy link
Member

shilman commented Feb 10, 2023

Can you please try to upgrade to the most recent beta? I believe this bug was fixed in Storybook core recently.

storybookjs/storybook#20809

@vekunz
Copy link
Author

vekunz commented Feb 13, 2023

It seems that this bug is fixed now.

@vekunz vekunz closed this as completed Feb 13, 2023
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

3 participants