-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Addon-docs: Fix source block error on dynamically-generated stories #14217
Conversation
Docs page throw an error `Cannot read property 'startBody' of undefined` when using generated stories because it cannot get its source code. The fix is using the same simple fallback to the whole story file same as when locationsMap is not passed from caller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. that said, i would highly discourage this pattern. we're planning to deprecate the storiesOf API in favor of statically analyzable CSF.
Cannot read property 'startBody' of undefined
when using generated stories
Thanks for approving and merging this. If you plan to deprecate "storiesOf" will be there some other way how to do stories generation? We use all possible variations of API responses to generate and validate how our UI will react to it. It is for us super valuable way of testing. |
Addon-docs: Fix source block error on dynamically-generated stories
Issue:
Docs page throw an error
Cannot read property 'startBody' of undefined
when using generated stories because it cannot get its source code from locationsMap.What I did
The fix is using the same simple fallback to the whole story file code same as when locationsMap is not passed from caller few lines above.
How to test
To simulate the situation it requires quite specific situation where we generate stories based on api response. (Note everything works well for us this way except the docs throw mentioned error).
story:
If your answer is yes to any of these, please make sure to include it in your PR.