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

Fix undefined story data #91

Merged
merged 1 commit into from
Mar 13, 2020

Conversation

jacobcoughenour
Copy link
Contributor

I was getting this error in my storybook for a svelte project:

TypeError: Cannot use 'in' operator to search for 'parameters' in undefined
    at renderTheme (vendors~main.44b08c472af3b68560ea.bundle.js:204953)

I added a check to see if the current story data is undefined before checking if it contains the "parameters" key.

I'm not sure why getCurrentStoryData() is returning null, but now renderTheme() can handle it.

@jacobcoughenour
Copy link
Contributor Author

I figured out that I was calling load() twice in my storybook config. Once I fixed that, the error is gone.

Maybe a warning should be added if getCurrentStoryData() returns null?

@hipstersmoothie hipstersmoothie merged commit b1855c5 into hipstersmoothie:master Mar 13, 2020
@hipstersmoothie
Copy link
Owner

🚀 PR was released in v0.3.1 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants