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

[Bug]: Rendering of MDX documentation fails when the imported stories file changes #29127

Open
szimek opened this issue Sep 14, 2024 · 0 comments

Comments

@szimek
Copy link

szimek commented Sep 14, 2024

Describe the bug

When adding a new story to a stories file that is imported in a .mdx file, the following error is thrown:

Invalid value passed to the 'of' prop. The value was resolved to a 'component or unknown' type but the only types for this block are: story.

It happens when the imported story files is modified in other ways as well, but this is the most simple case to replicate this bug.

Reproduction link

https://stackblitz.com/edit/github-unrkza-3cuztn?file=src%2Fstories%2FButton.stories.ts

Reproduction steps

  1. Go to the link above
  2. Open "Buttons documentation" doc in the preview pane
  3. Open src/stories/Button.stories.tsx file
  4. Duplicate e.g. the Secondary story and rename it to e.g. Tertiary

Expected behavior:
The doc is still rendered correctly.

Actual behavior:
The error mentioned above it thrown.

System

I'm not sure how to run `npx storybook@latest info` on StackBlitz, as the terminal does not seem to work for me. I am using the React 18 Webpack template, which uses Storybook 8.4.0-alpha.0.

Additional context

It makes writing documentation using MDX files a bit frustrating ;)

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

1 participant