Story not rendering in Docs mode while using MDX
See original GitHub issueAfter 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:
- Create an MDX story.
- import { Meta, Story, Preview, Props } from “@storybook/addon-docs/blocks”;
- Include a section with a <Props of {YourComponent}
- 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:
- Created 3 years ago
- Reactions:4
- Comments:8 (3 by maintainers)
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)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!