-
Notifications
You must be signed in to change notification settings - Fork 106
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
Fix: svelte #240
Fix: svelte #240
Conversation
Thanks for this PR, @bfanger! It looks like our check might need to be updated too?
|
Ah, I missed adding a file in last commit. the locally compiled version of storybook-builder-vite already contained the change. Not sure why CI fails on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! When running packages/example-svelte
, I'm seeing this error in the browser console.
ClientApi.js:85 Uncaught Error: Singleton client API not yet initialized, cannot call `addArgTypesEnhancer`.
Any idea why that might be?
Also, I needed to add @storybook/svelte
to the list in optimizeDeps.ts
. Would you mind doing that here as well?
// const __storiesMetaData = parser(${componentName}, ${JSON.stringify(storiesDef)}); | ||
// export default __storiesMetaData.meta; | ||
// ${storyDef}; | ||
// `); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why is this commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the comment, (I copied it from @storybook/addon-svelte-csf for reference, but in contrary to the error message, the export was not the issue.)
Uncaught Error: Singleton client API not yet initialized, cannot call After a to fix that issue. I think that's a bug in yarn, it should dedupe that dependency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was really hoping somehow this would fix that issue, but yeah, I think it's some kind of yarn bug.
But yeah, after jumping through the hoops of removing the extra deps, this works great. Thanks for the help!
TypeError: RegisterContext is not a constructor
error. (Svelte compiler was in 'ssr' mode)Fixes #224
(Also implemented support for preprocessors inside *.stories.svelte files)