【问题标题】:React Storybook unable to render a storyReact Storybook 无法渲染故事
【发布时间】:2022-07-22 16:29:49
【问题描述】:

我正在尝试使用包含主题的故事书文件夹创建文档。但收到此错误:

Uncaught Error: Unable to render story ... as the component annotation is missing from the default export

Migration.stories.mdx

import { Meta, Story} from '@storybook/addon-docs';

<Meta title="Documentation / Visual Update Migration" />

# Migrating

<Story name="Card" />

## Card

-   Text
-   Text

<Story name="Container" />

## Container

-   Text
-   Text

所有这些都会导致故事标记,但如果我删除它们,侧边栏中将不会有参考

预期

所以,路径和侧边栏加载正确,但点击内容不加载给出错误。

Uncaught Error: Unable to render story documentation-visual-update-migration--card as the component annotation is missing from the default export ...
Uncaught Error: Unable to render story documentation-visual-update-migration--container as the component annotation is missing from the default export ...

加号

2 The above error occurred in the <storyFn> component ...

POST http://localhost:6006/runtime-error 404 (Not Found)
POST http://localhost:6006/runtime-error 404 (Not Found)

【问题讨论】:

    标签: reactjs storybook


    【解决方案1】:

    问题出在&lt;Story ... /&gt;Story 想要里面的东西。

    修复: &lt;Story ...&gt;{''}&lt;/Story&gt;

    【讨论】:

      猜你喜欢
      • 2020-09-28
      • 2022-12-17
      • 2020-05-02
      • 2020-10-30
      • 2016-01-05
      • 2021-01-23
      • 1970-01-01
      • 2017-03-24
      • 1970-01-01
      相关资源
      最近更新 更多