storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
83.52k stars 9.14k forks source link

[Bug]: manager received preloadStories but was unable to determine the source of the event #24577

Open maersk-ps opened 8 months ago

maersk-ps commented 8 months ago

Describe the bug

I am currently facing this issue only on the deployed version, locally unable to reproduce this issue .

I am using "storybook": "^7.4.0".

Please help

Screenshot 2023-10-25 at 6 24 22 PM

To Reproduce

No response

System

No response

Additional context

No response

Pettor commented 8 months ago

I have the same issue. I use composition for Storybook. If I manually clear the site data it will load but on next reload it will start failing.

Here is a link to my currently deployed storybook on Github pages. It will most likely load on the first try but reloading will cause the preloadStories error.

https://pettor.github.io/template-web-app-react

realashleybailey commented 8 months ago

Same issue for me, exact same deployment as @Pettor

kabdelkareem commented 6 months ago

same issue as well

shilman commented 6 months ago

Do you a have a reproduction repo you can share? If not, can you create one? Go to https://storybook.new or see repro docs. Thank you! 🙏

yowook commented 6 months ago

same here as well

Pettor commented 5 months ago

@shilman You can always check https://github.com/Pettor/template-web-app-react out. Just use the Storybook link. It will load the first time but after refreshing you will see errors in the console and the stories won't load.

The main app used for building the published Storybook can be located in apps/web.

Pettor commented 5 months ago

I most likely figured out my issue. In my Vite config for the web project I had a PWA plugin that inject a service worker and other stuff. I thought I was overriding this plugin in the main.ts file for Storybook but it was actually added in the list. Removing the PWA seem to have solved my issue 🙂

Not sure what the best method for making Storybook ignore the main vite.config.ts file but I simply added a env variable when building Storybook that will return an empty config file for now and let main.ts take care of the configuration.

kspeyanski commented 3 months ago

Had the same exact problem. I was serving my content with npx server -s storybook-static. Removing the -s flag resolved the issue completely.

This is what the -s flag does, according to it's API. Maybe there's some rewriting happening in your deployment?

    -s, --single                        Rewrite all not-found requests to `index.html`