-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Storybook v6.1.5 with Svelte fails to start #13247
Comments
@j3rem1e same issue here, rolling back to 6.0.12 fixes the problem in my project |
Any news on this issue ? Creating every components is probably not a good idea, it causes a lot a side effects, like this issue or #13351 |
Boo-yah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.0-alpha.4 containing PR #13386 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Boo-yah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.11 containing PR #13386 that references this issue. Upgrade today to the
|
I tested to upgrade to 6.1.11, but it doesn't really work. My storybook starts now, but most of the stories are break. Svelte is not robust when there is exception in the initialisation of a component. the global state can be corrupted. Is there a way to opt-out of this function ? btw, i can't reopen this issue @shilman |
I have a working patch to make it works without instanciating every components : I have changed the webpack svelte docgen to be a post processor (was a preprocessor). Then in this loader, I give the component source to the svelte docgen parser and inject a __docgen static field into the class. In extractArgTypes, I can then just get the docgen properties with @BlackFenix2 is it an acceptable solution for you ? |
@j3rem1e Is that something you can PR? |
@j3rem1e sounds good, i prob should of made the __docgen property static anyway. If this works locally in the svelte example for you fell free to submit a PR. |
Zoinks!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.0-alpha.9 containing PR #13466 that references this issue. Upgrade today to the
|
Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.14 containing PR #13466 that references this issue. Upgrade today to the
|
Describe the bug
Storybook v6.1.5 doesn't work with Svelte if a story use a component with a mandatory property.
To Reproduce
Create a Story with a Svelte component which assume a property is set.
For example :
It's related to this PR by @BlackFenix2 : #12347
In this PR, every component are instanciated without properties, in order to extract the generated documentation here : https://github.com/storybookjs/storybook/blob/next/addons/docs/src/frameworks/svelte/extractArgTypes.ts#L37
It doesn't work if the component has mandatory properties.
More over, it assumes every component have a docgen here : https://github.com/storybookjs/storybook/blob/next/addons/docs/src/frameworks/svelte/extractArgTypes.ts#L48
This not always the case (if a component doesn't have any property, then docgen will be undefined but I am not 100% sure about that). If a component have docgen is not defined, then the Storybook doesn't starts.
The text was updated successfully, but these errors were encountered: