storybookjs/storybook

Feature: Storybook doesn't show an error for a story file with Meta but no stories

開放

#21,375 建立於 2023年3月3日

 (3 則留言) (0 個反應) (0 位負責人)TypeScript (10,058 個分叉)batch import
feature requesthelp wantedstory index

倉庫指標

星標
 (89,909 顆星)
PR 合併指標
 (平均合併 7天 22小時) (30 天內合併 184 個 PR)

描述

Describe the bug

If you create a sandbox e.g. npx storybook@next sandbox then run Storybook

Then modify the contents of the Button.stories file to only this:

export default {
  title: 'Hello',
}

or

import { Button } from './Button'
export default {
  component: Button
}

Storybook will not display any errors in the CLI or in the browser, and the Button component will not be visible in the sidebar:

Additionally, you get the same behavior if you change the contents of the story file to be:

import { Button } from './Button'
export default {
  component: Button,
  excludeStories: 'Default'
}

export const Default = {}

貢獻者指南