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

Only last component is shown, storyMissing is thrown for the rest #7545

Closed
siffash opened this issue Jul 24, 2019 · 1 comment
Closed

Only last component is shown, storyMissing is thrown for the rest #7545

siffash opened this issue Jul 24, 2019 · 1 comment

Comments

@siffash
Copy link

siffash commented Jul 24, 2019

Describe the bug
Storybook loads all components one by one (not all of them at once) and shows only the last one.

To Reproduce
Steps to reproduce the behavior:

  1. Create components and stories for them.
  2. Load them into Storybook, everything works fine.
  3. Export the components with their stories files to bit.dev
  4. Install the components from bit.dev to another project.
  5. Load them into Storybook (see the code snippet).
  6. The components are loaded one by one, and only the last component is shown.
  7. In the console (when verbose is checked):
    7.1. setStories is run for each component (not once for all components)
    7.2. storyMissing is thrown for all components except the last one:
    (18) message arrived at manager storyMissing undefined

Expected behavior
All components to be loaded and shown together.

Code snippets
config.ts:

import { configure } from '@storybook/react';
const req = require.context('@bit/', true, /stories\.tsx$/);
function loadStories() {
req.keys().forEach(req);
}
configure(loadStories, module);

System:

  • OS: MacOS Mojave 10.14.5
  • Device: Macbook Pro 2017
  • Browser: Chrome 75.0.3770.142
  • Framework: React 16.8.6
  • Version: 5.1.9 (tried @next as well)
@siffash siffash changed the title Only last stories are shown, storyMissing is thrown for the rest Only last story is shown, storyMissing is thrown for the rest Jul 24, 2019
@siffash siffash changed the title Only last story is shown, storyMissing is thrown for the rest Only last component is shown, storyMissing is thrown for the rest Jul 24, 2019
@siffash
Copy link
Author

siffash commented Jul 26, 2019

The problem was with node_modules of each component, removing that directory for each component solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants