Storybook: Story not rendering in Docs mode while using MDX

Created on 12 Jun 2020  路  8Comments  路  Source: storybookjs/storybook

After upgrading to 6.0.0-beta.25, from an earlier 6.0.0 version, our documentation stopped working entirely. Every story with a

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
  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 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(R) Core(TM) 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.

docs inactive mdx needs reproduction question / support

Most helpful comment

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)

All 8 comments

@davidjungermann Do you have a public repro I can look at?

It's for a work project, but I will sort a repro repository as soon as possible!

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)

Hmm, have tried various forms of updating throughout the day, but haven't got it working yet. I'll get back here if I manage. Something is probably wrong on our end. Thanks for the help anyways :)

@davidjungermann another unfortunate trick that's sometimes necessary is deleting node_modules AND refreshing your lock file. good luck!

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

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!

Was this page helpful?
0 / 5 - 0 ratings