-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Broken/outdated stories crash app #377
Comments
Hey thanks for raising this issue. I suppose it could be possible to avoid fatal crashes by having an error boundary. As a workaround could you try adding a global decorator with an error boundary? If its successful I could add something like that to the package. |
@nurse-the-code are you able to test it with an error boundary? |
@dannyhw That is a good idea. I considered adding one in my code. I will have to check it out. Might try to do that after work. |
Error boundary will give you a fancy error page, but will not prevent the storybook from crashing. 😢 |
@iuricmp well an error boundary could be put in the storybook UI, maybe that would solve this? |
I have a fix for this in v7 which should have a beta relatively soon. |
this was fixed in v7 |
Describe the bug
As a codebase evolves overtime, sometimes stories get broken (often because the components the stories were testing were updated without checking how that effects the rendering in Storybook). When another developer taps on that story in Storybook, it causes the whole Storybook environment to crash and the app has to be rebuilt. A single broken story (or even several broken stories) should not crash the whole Storybook environment. This results in significant lack of productivity when using Storybook and causes a significant negative user experience impact.
To Reproduce
Steps to reproduce the behavior:
Create a broken story (a great way to do this is to import a component without its state or Provider, or to provide invalid props -- when using TypeScript or PropTypes). Then try to click/tap on that story in Storybook. Depending on how significant the error is (e.g. "red" vs "yellow" error), an error will show up taking up the entire screen and when you dismiss the error the screen is black. The only way to get back to Storybook is to delete the app from the device, rebuild the app, and make sure not to tap on the broken component again.
Expected behavior
Broken stories (e.g. with invalid props or missing Providers, state) should not crash the entire Storybook environment.
Screenshots
If applicable, add screenshots to help explain your problem.
Code snippets
If applicable, add code samples to help explain your problem.
System:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: