Closed gunti96 closed 8 months ago
@gunti96 Reordering the requires shouldn't matter, that would suggest to me theres a different issue with your story or something. Are you able to provide a reproduction of the issue in a public repo?
since there has been no response I'm closing this for now, let me know if you want to reopen
Getting a similar issue, but this is after upgrading to React 18. Does react-native storybook support react 18?
there is no difference for react 18, if you have a reproduction then I can try to offer more insight but I can't tell what your problem is without more details.
@bsheikh I just published a potential fix in 6.5.7 can you check
Describe the bug It matters the order of specifying stories inside
getStories
method (storybook.requires.js
file).npm run storybook-generate
, it generates the stories insidegetStories
in a specific order, and when I run the app I get theCannot read property of 'stories' of undefined
error. Please check below video.getStories
, it may just work perfectly without errors. I change nothing else, just the order of stories insidestorybook.requires.js
->getStories
.So it is a strange behavior, and basically enforces me to not use the
"storybook-generate": "sb-rn-get-stories"
script provided by you for regenerating thestorybook.requires.js
file. I update it manually and I need to find an order which is okay and does not crashes the app. I did not found a rule for this yet.Expected behavior Should run without errors regardless the order of stories inside
getStories
Screenshots
https://github.com/storybookjs/react-native/assets/124141134/64509e64-4ad8-49e2-826b-1e2fb551e825
Code snippets
System: Storybook Environment Info:
System: OS: macOS 13.1 CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz Shell: 3.2.57 - /bin/bash Binaries: Node: 16.14.2 - /usr/local/bin/node Yarn: 1.22.18 - /usr/local/bin/yarn <----- active npm: 8.5.0 - /usr/local/bin/npm Browsers: Chrome: 116.0.5845.187 Safari: 16.2 npmPackages: @storybook/addon-actions: ^6.5.16 => 6.5.16 @storybook/addon-controls: ^6.5.16 => 6.5.16 @storybook/addon-ondevice-actions: ^6.5.6 => 6.5.6 @storybook/addon-ondevice-controls: ^6.5.6 => 6.5.6 @storybook/react-native: ^6.5.6 => 6.5.6
Additional context