Skip to content

Crash depending on order of stories inside getStories method #513

@gunti96

Description

@gunti96

Describe the bug
It matters the order of specifying stories inside getStories method (storybook.requires.js file).

  • For example, if I execute npm run storybook-generate, it generates the stories inside getStories in a specific order, and when I run the app I get the Cannot read property of 'stories' of undefined error. Please check below video.
  • But, if I manually reorder the stories differently inside getStories, it may just work perfectly without errors. I change nothing else, just the order of stories inside storybook.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 the storybook.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

Inregistrare.ecran.din.2023-09-14.la.18.55.48.mov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions