storybook: Storybook does not show any stories!

I tried adding Storybook into a newer project. I have used Storybook before, but the last version I was running was 5.3.18. Today I did a fresh install. But after everything was set up and running, the Storybook app does not show many any of the created stories:

image

The main.js looks like this:

module.exports = {
  stories: [
    '../src/**/*.stories.js'
  ],
  addons: [
    '@storybook/addon-essentials',
    '@storybook/addon-links'
  ],
}

I have now 1 very simple story in my project that should show up as configured:

The path to it is ./src/common/components/Badge/Badge.stories.js from the project root. Storybook runs without an issue:

image

And the story is also very simple:

import { Badge } from './Badge';

export default {
  title: 'Badge',
  component: Badge,
};

There are no errors reported or anything that could lead me to any potential cause.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (10 by maintainers)

Most upvoted comments

You doesn’t export any stories. You should maybe add :

export const Default = (args) => <Badge {...args}/>

The syntax depends on your framework, I assumed it’s React.

I can confirm that this solution works now. At least we can continue with our project. Thank you very much.