Cannot read property 'displayName' of undefined
See original GitHub issueDescribe the bug
Test suite failed to run
TypeError: Cannot read property 'displayName' of undefined
1 | import initStoryshots from '@storybook/addon-storyshots'
2 |
> 3 | initStoryshots({
| ^
4 | framework: 'react-native',
5 | })
6 |
at getDisplayName (node_modules/@emotion/primitives-core/dist/primitives-core.cjs.dev.js:232:64)
at Function.createStyledComponent (node_modules/@emotion/primitives-core/dist/primitives-core.cjs.dev.js:225:41)
at Object.<anonymous> (node_modules/@storybook/react-native/dist/preview/components/StoryListView/index.js:110:20)
at Object.<anonymous> (node_modules/@storybook/react-native/dist/preview/components/OnDeviceUI/index.js:46:45)
at Object.<anonymous> (node_modules/@storybook/react-native/dist/preview/index.js:58:42)
at Object.<anonymous> (node_modules/@storybook/react-native/dist/index.js:12:39)
at Object.load (node_modules/@storybook/addon-storyshots/dist/frameworks/rn/loader.js:36:29)
at loadFramework (node_modules/@storybook/addon-storyshots/dist/frameworks/frameworkLoader.js:31:17)
at Object.testStorySnapshots [as default] (node_modules/@storybook/addon-storyshots/dist/api/index.js:53:36)
at Object.<anonymous> (__tests__/storyshots.spec.ts:3:15)
System:
- OS: MacOS
- Framework: React Native 0.59.10
- Addons: Storyshots
- Version: “@storybook/addon-storyshots”: “5.1.9” “@storybook/react-native”: “5.1.9”
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Storybook cannot read property 'displayName' of undefined
Apparently, I was importing a Navbar, my component's name is Header. Also there is a difference between export default function () {} and ......
Read more >How to fix the error “Cannot read property 'displayName' of ...
The other day, I got the error “Cannot read property 'displayName' of undefined” in my project. The specs of my project are as...
Read more >Cannot read property 'displayName' of undefined
Hi. happens in quite all of my flows,. Flow ID 708c7cf1-1bb2-4dfb-bcbc-3326b33c75c1. Flow ID 9dedfade-9002-4ec6-88a7-9f3ceceb0577.
Read more >cannot read properties of undefined (reading 'displayname ...
Here's an example of a JavaScript TypeError: Cannot read property of undefined thrown when a property is attempted to be read on an...
Read more >Error Parsing NME Snippet - `TypeError: Cannot set property ...
TypeError : Cannot set property 'displayName' of undefined is reported when trying to load my NME snippet ( #YDTJYX#2 ) in Babylon v4.2.0....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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: