Storybook: [addon-docs] Cannot read property 'props' of undefined

Created on 6 Nov 2019  路  7Comments  路  Source: storybookjs/storybook

Describe the bug

Upgrading @storybook/addon-docs from 5.3.0-alpha.33 to 5.3.0-alpha.39 gives the error:

Cannot read property 'props' of undefined

when using <Props of={ SomeComponent } />.

To Reproduce

Upgrade @storybook/addon-docs from 5.3.0-alpha.33 to 5.3.0-alpha.39.

Expected behavior

Props table should be shown.

Code snippets

some-component.mdx

import { Meta, Story, Preview, Props } from '@storybook/addon-docs/blocks';
import { withKnobs, text } from '@storybook/addon-knobs';
import SomeComponent from './index';

<Meta title="SomeComponent" component={ SomeComponent } />

<Preview withToolbar>
  <Story name="Default" parameters={ { decorators: [ withKnobs ] } }>
    <SomeComponent text={ text( 'Text', 'Lorem Ipsum' ) }/>
  </Story>
</Preview>

<Props of={ SomeComponent } />

System:

System:
  OS: macOS Mojave 10.14.6
  CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Binaries:
  Node: 12.10.0 - /usr/local/bin/node
  Yarn: 1.19.0 - /usr/local/bin/yarn
  npm: 6.12.1 - /usr/local/bin/npm
Browsers:
  Safari: 13.0.3
npmPackages:
  @storybook/addon-docs: ^5.3.0-alpha.39 => 5.3.0-alpha.39
  @storybook/addon-knobs: ^5.3.0-alpha.39 => 5.3.0-alpha.39
  @storybook/react: ^5.3.0-alpha.39 => 5.3.0-alpha.39
docs props bug needs reproduction

Most helpful comment

This has been resolved since at least 5.3.0-beta.10. More context in #8162.

All 7 comments

Whoopee!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.0-alpha.41 containing PR #8731 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

Upgraded, but still seeing the same result.

Environment Info:

  System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  Binaries:
    Node: 12.10.0 - /usr/local/bin/node
    Yarn: 1.19.0 - /usr/local/bin/yarn
    npm: 6.12.1 - /usr/local/bin/npm
  Browsers:
    Safari: 13.0.3
  npmPackages:
    @storybook/addon-docs: ^5.3.0-alpha.41 => 5.3.0-alpha.41
    @storybook/addon-knobs: ^5.3.0-alpha.41 => 5.3.0-alpha.41
    @storybook/react: ^5.3.0-alpha.41 => 5.3.0-alpha.41

Screenshot 2019-11-07 13 51 06

@ryanfitzer do you have a repro repo you can share?

@patricklafrance It looks like this was a valid concern after all. Do you mind taking a look at the bug?

Sure, I will have a look after the refactor.

If you can add a repro case to the cra-ts-kitchen-sink that would be awesome!

@shilman

This has been resolved since at least 5.3.0-beta.10. More context in #8162.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ZigGreen picture ZigGreen  路  3Comments

sakulstra picture sakulstra  路  3Comments

shilman picture shilman  路  3Comments

purplecones picture purplecones  路  3Comments

levithomason picture levithomason  路  3Comments