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

Svelte Dynamic snippets doesn't work without user interactions #14443

Closed
j3rem1e opened this issue Apr 1, 2021 · 3 comments
Closed

Svelte Dynamic snippets doesn't work without user interactions #14443

j3rem1e opened this issue Apr 1, 2021 · 3 comments

Comments

@j3rem1e
Copy link
Contributor

j3rem1e commented Apr 1, 2021

Describe the bug

The source dynamically generated for a svelte story isn't show until the user changes an arg or clicks on another story.

This is caused by this commit 5c1e2b4

In order to support "async loaders", the function prepareForInline is asynchronous. However, the SourceContainer doesn't seem to be able to handle asynchronous source events.

To Reproduce
Steps to reproduce the behavior:

  1. In svelte-kitchen-sink, open the Button story
  2. Click on the "Doc" tab
  3. The preview doesn't have any sources attached
  4. Change a property
  5. The source is updated but show the previous code (change in 4 is not visible)

Additional context
Storybook v6.2.1, Svelte addon

┆Issue is synchronized with this Asana task by Unito

@j3rem1e
Copy link
Contributor Author

j3rem1e commented Apr 1, 2021

@shilman I don't know if we should revert the commit or fix the real bug: Today, the doc addon can't handle asynchronous loader.

The injection of args from the url doesn't seem to work either.

@shilman
Copy link
Member

shilman commented Apr 1, 2021

@j3rem1e let's revert the async loader support. it doesn't work in other frameworks yet anyways, so we can bring it back later

@shilman
Copy link
Member

shilman commented Apr 2, 2021

Jeepers creepers!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.2 containing PR #14444 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants