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

Cannot read property 'name' of undefined #33

Closed
META-DREAMER opened this issue Jul 22, 2019 · 13 comments
Closed

Cannot read property 'name' of undefined #33

META-DREAMER opened this issue Jul 22, 2019 · 13 comments

Comments

@META-DREAMER
Copy link

Describe the bug
When running the on device storybook on react native, as soon as I select one of my stories, I get an error: TypeError: Cannot read property 'name' of undefined.

To Reproduce

  1. Go to on device story book
  2. Open "Navigator" tab
  3. Click on a story

Expected behavior
Story should render as usual without errors

Screenshots
video here

Code snippets
If applicable, add code samples to help explain your problem.

System:

  • OS: iOS
  • Device: iPhone X
  • Framework: react-native
  • Addons: ondevice-knobs, ondevice-backgrounds and ondevice-notes
  • Version: 5.2.0-beta.6

Additional context
I tried using the latest stable version as well (5.1.9), it didn't give errors but it wouldn't do anything when I clicked my stories in the navigator.

@stale
Copy link

stale bot commented Aug 13, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@META-DREAMER
Copy link
Author

@shilman @benoitdion @Gongreg Any update on this? This is completely preventing me from using storybook.

@stale
Copy link

stale bot commented Sep 3, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@META-DREAMER
Copy link
Author

@shilman @benoitdion @Gongreg Not stale

@Madsim
Copy link

Madsim commented Dec 5, 2019

I ran into the same problem, today. Any setup steps that could be missing, but are not documented well? I (try to) use CSF.

Sorry did not realize this is labeled with react-native. I have the same problem in react.

Additional Details:
It seems the hookify function expects a decorator name and can't find it.
The error occurs at:

var prevDecoratorName = hooks.currentDecoratorName;
hooks.currentDecoratorName = fn.name;

All decorators I use are defined in config like this:

import { configure, addDecorator, addParameters } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';
import { withDocs } from '@storybook/addon-docs';

addDecorator(withKnobs);
addDecorator(withDocs);

@Gongreg
Copy link
Member

Gongreg commented Dec 5, 2019

Hi. CSF is not supported in RN

@Madsim
Copy link

Madsim commented Dec 5, 2019

Hi. CSF is not supported in RN

I updated my answer

@Gongreg
Copy link
Member

Gongreg commented Dec 6, 2019

@shilman, take a look above.

@aloukianova-godaddy
Copy link

@Madsim
I had the same problem - I was importing a decorator in storybook/config.js that I had removed. Check that all decorators that you use do, in fact, exist.

@shilman
Copy link
Member

shilman commented Dec 7, 2019

@Madsim there is no withDocs in addon-docs

import { withDocs } from '@storybook/addon-docs';

@Madsim
Copy link

Madsim commented Dec 7, 2019

@shilman that solved it for me, don‘t know about the original question asker, though. Thanks :)

@META-DREAMER META-DREAMER reopened this Feb 4, 2020
@stale
Copy link

stale bot commented Feb 27, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@Gongreg Gongreg transferred this issue from storybookjs/storybook Feb 27, 2020
@dannyhw
Copy link
Member

dannyhw commented Aug 13, 2020

Please let me know if this is still and issue, I'm closing this due to inactivity in the meantime

@dannyhw dannyhw closed this as completed Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants