-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 'displayName' of undefined #7390
Comments
@benoitdion @Gongreg node_modules/@storybook/react-native/dist/preview/components/StoryListView/index.js:111 |
if I change behavior to this
I got this error
|
Then, I've changed my jest.config.js
And got this
|
@stereodenis I appear to be facing this same issue - how was it resolved for you? |
I've run into this issue as well. @stereodenis since you've closed the problem, would you be able to explain what fixed it please? |
Check the components you are importing. If they are undefined then you will get this error. |
In my case I got the error by importing {Component} instead of Componet without the curly braces |
In my case it was because I imported the component as a named import instead of default import. So I fixed it from this:
To this:
|
Seems like the cache is messing up somehow. Removing the npm cache and restarting storybook solves things, but the problem comes back.
|
I had the same issue, in my case it was indeed due to an imported module being undefined in one of my deeply nested components. For me, this was happening on the initial render, but if I changed anything in the corresponding component (which possibly lead to re-loading the incorrect module), it reloaded the UI due to HMR, and it worked fine. The problematic module was using some global variables, which were not defined in storybook webpack. Once that was fixed, this problem went away. Still don't know why it did not work initially, but worked on HMR (after making any random changes in the files, which lead to re-building the module once again i guess) |
Same thing was happening to me, ends up i was including something that was exported from another file that imported redux store/history, and this was a big no-no. If you file interacts with redux prepare for pain (unless you're using providers which I don't want to do). |
My file name was ReservationPassengersTrain.tsx it did not worked. |
For what it's worth, I randomly got this error and it went away just by restarting storybook. (v6.3.7) |
This solved this error for me, I had to dig deep to find the component. |
Remove your child components one by one, as this will help you identify which one is missing a property. |
Describe the bug
System:
"@storybook/addon-storyshots": "5.1.9"
"@storybook/react-native": "5.1.9"
The text was updated successfully, but these errors were encountered: