question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Story not rendering in Docs mode while using MDX

See original GitHub issue

After upgrading to 6.0.0-beta.25, from an earlier 6.0.0 version, our documentation stopped working entirely. Every story with a <Props of {Component}> tag resulted in a lot of errors having to do with PropContainer. This in turn resulted in nothing being rendered for the affected story. If this tag is not present, the targeted component renders correctly. Any help would be much appreciated!

To Reproduce Steps to reproduce the behavior:

  1. Create an MDX story.
  2. import { Meta, Story, Preview, Props } from “@storybook/addon-docs/blocks”;
  3. Include a section with a <Props of {YourComponent}
  4. Get the following errors:

"react-dom.development.js:23965 Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it’s defined in, or you might have mixed up default and named imports.

Check the render method of PropsContainer. at createFiberFromTypeAndProps (react-dom.development.js:23965) at createFiberFromElement (react-dom.development.js:23988) at reconcileSingleElement (react-dom.development.js:14233) at reconcileChildFibers (react-dom.development.js:14293) at reconcileChildren (react-dom.development.js:16762) at mountIndeterminateComponent (react-dom.development.js:17542) at beginWork (react-dom.development.js:18596) at HTMLUnknownElement.callCallback (react-dom.development.js:188) at Object.invokeGuardedCallbackDev (react-dom.development.js:237) at invokeGuardedCallback (react-dom.development.js:292)"

“The above error occurred in the <PropsContainer> component: in PropsContainer (created by MDXCreateElement) in MDXCreateElement (created by MDXContent) in wrapper (created by MDXCreateElement) in MDXCreateElement (created by MDXContent) in MDXContent (created by page) in AddContext (created by page) in page in div (created by Context.Consumer) in Styled(div) (created by DocsContainer) in div (created by Context.Consumer) in Styled(div) (created by DocsContainer) in MDXProvider (created by DocsContainer) in ThemeProvider (created by DocsContainer) in DocsContainer”

No components are rendered in the Docs for the given story.

Expected behavior The component, along with the props are presented.

System: Environment Info:

System: OS: Windows 10 10.0.18363 CPU: (8) x64 Intel® Core™ i7-4810MQ CPU @ 2.80GHz Binaries: Node: 10.16.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.21.1 - ~\AppData\Roaming\npm\yarn.CMD npm: 6.10.0 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: 44.18362.449.0 npmPackages: @storybook/addon-actions: ^6.0.0-alpha.1 => 6.0.0-beta.25 @storybook/addon-docs: ^5.3.9 => 5.3.19 @storybook/addon-links: ^6.0.0-alpha.1 => 6.0.0-beta.25 @storybook/addons: ^5.3.19 => 5.3.19 @storybook/preset-create-react-app: ^1.5.2 => 1.5.2 @storybook/react: ^6.0.0-alpha.9 => 6.0.0-beta.25 @storybook/theming: ^5.3.19 => 5.3.1

Additional context Everything works as intended on v.6.00-alpha.9.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
shilmancommented, Jun 12, 2020

Oh hey, you need to update ALL your Storybook packages to 6.0.0-beta.25. I bet that fixes it. In general the versions should always match, but especially across major version bumps (e.g. 5.3 => 6.0)

0reactions
stale[bot]commented, Oct 4, 2020

Hey there, it’s me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source - Storybook - JS.ORG
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >
How to build a Storybook addon - Chromatic
The actual DOM node for the preview is different in these two modes. In fact, the docs mode renders multiple story previews on...
Read more >
Lessons Learned: Storybook JS with Angular
MDX or TS Documentation? documentation.json. Development. Rebuilding and Watch Mode. When developing with Storybook locally with 'npm run ...
Read more >
Storybook won't render docs when using custom MDX story #16902
IssueHunt = OSS Development ⚒ + Bounty Program . IssueHunt is an issue-based bounty platform for open source projects. Anyone can put a...
Read more >
Storybook for everyone: CSF vs. MDX - DEV Community ‍ ‍
Tagged with storybook, react, designsystems, docs. ... Storybook introduced the option of writing stories using MDX Format so we can easily ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found