storybookjs / storybook

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

Fail `build-storybook` in CLI if it outputs a static build that doesn't load #16558

Open domyen opened 2 years ago

domyen commented 2 years ago

Is your feature request related to a problem? Please describe When running build-storybook it can complete successfully but still yield a broken static build when you try to open index.html in the browser.

This makes it hard for users to debug why static Storybooks aren't working when they publish to Chromatic, Netlify, etc because if the build-storybook command completes I assume everything works.

Frequent errors in the static build:

Describe the solution you'd like I'd like build-storybook to fail when there are errors in the static build. That makes it clearer what to debug for everyone that publishes Storybook online.

Are you able to assist to bring the feature to reality? No, I don't know enough about the CLI.

Tim-arts commented 2 years ago

Hello, I have this exact issue while building Storybook, the build passes but when you try to open the index.html it's actually broken: image

Note that the npx http-server ./storybook-static works

shilman commented 2 years ago

I'll address the feature request in another comment

@Tim-arts do you have a reproduction of your specific issue that I can look at? Does it work in dev mode?

ndelangen commented 1 year ago

@Tim-arts that sounds more like there might be a problem with the http server, or pathing rather then with storybook's output.

What's are the differences between npx http-server and where you're hosting your built storybook?