tuchk4 / storybook-readme

React Storybook addon to render README files in github style
MIT License
544 stars 249 forks source link

cannot read property theme of undefined #228

Open Harshmakadia opened 4 years ago

Harshmakadia commented 4 years ago

Hi I'm trying to use the withDocs and withReadme But for some reasons it's given be this error.

Screenshot 2020-03-27 at 2 18 18 PM

I'm using the following version of "storybook-readme": "^5.0.8",

Here is my sample code

storiesOf('Avatar', module)
  .addDecorator(withKnobs)
  .addDecorator(withDocs(AvatarDocs))
  .addDecorator(withReadme(AvatarReadme))
  .add('Avatar Usage',() => (
    <AvatarStory
      img={text('img', 'https://greatindiantours.com/wp-content/themes/travel-log/images/dummy-user.jpg')}
      height={number('height', 60)}
      width={number('width', 60)}
      circle={boolean('circle', false)}
      altText={text('altText', 'User Icon')}
    />
  ))

As soon as I add .addDecorator(withDocs(AvatarDocs)) and .addDecorator(withReadme(AvatarReadme)) It gives me above error. Am I missing something?

bbellmyers commented 4 years ago

This is happening for me too. Seems related to upgrading storybook from 5 to 6 for me

bbellmyers commented 4 years ago

Solution: https://github.com/tuchk4/storybook-readme/issues/221