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

"No Preview" when starting Storybook for the first time #15310

Closed
yannbf opened this issue Jun 21, 2021 · 3 comments
Closed

"No Preview" when starting Storybook for the first time #15310

yannbf opened this issue Jun 21, 2021 · 3 comments

Comments

@yannbf
Copy link
Member

yannbf commented Jun 21, 2021

Describe the bug

Sometimes when running Storybook for the first time of the day, it opens the browser with a "No Preview" error (404 for story url).
Then you need to switch between stories a couple of times till they are actually rendered.

image

This was once reported in #14376

To Reproduce

I believe you can just use sb repro and select any framework, then run it for the first time. That should get you to the error. Another way that I found to reproduce a similar behavior is to:

1 - Open a storybook normally (you can use this deployed one for experimentation)
2 - Change url to wrong story name
3 - Get the 404 "No preview" screen
4 - When switching stories one time, you see that it won't render correctly (it does load the args though).

My assumption is that sometimes when initialising Storybook, the initial story is not loaded correctly, giving the 404 screen, and then you have this situation where you need to select another story, and still you have the 404 page, until you select a second story, then it works.

404-error.mp4
@shilman
Copy link
Member

shilman commented Jun 21, 2021

I think the first 404 might be caused by running Storybook on a port you've already run it on in the past, and some kind of caching there. We see it from time to time because we run a lot of different Storybooks on typical ports (e.g. 6006) but I don't think most users experience that.

The second click concerns me more because it's clearly loading the story at some level but not displaying it properly.

@yannbf yannbf changed the title https://github.com/storybookjs/storybook/issues/14376 "No Preview" when starting Storybook for the first time Jun 21, 2021
@shilman shilman added this to the 6.4 improvements milestone Jun 21, 2021
@shilman
Copy link
Member

shilman commented Jun 25, 2021

Boo-yah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.0-alpha.1 containing PR #15349 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Jun 25, 2021
@shilman
Copy link
Member

shilman commented Jun 28, 2021

Jiminy cricket!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.3.1 containing PR #15349 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