Storybook: PropTypes are missing in info panel in static build

Created on 15 Aug 2017  路  6Comments  路  Source: storybookjs/storybook

Couldn't find this issue anywhere so I am reporting it here.

It seems that when using the info-addon, the proptypes to a components works when you run storybook locally, but all proptypes are defaulted to type node in a static build of storybook.

The required field is also reset to no in a static build. Default seems to work though.

Here is a picture of it running locally
live

And here is how it looks once it's built static
static

Versions are

  • @storybook/react v3.2.4
  • @storybook/addon-info v3.2.4
info bug

Most helpful comment

I think I know what's happening here. On prod, PropTypes get stripped out because it's not necessary in the traditional prod environment sense. Also, the babel-plugin-react-docgen doesn't run.

All 6 comments

I think I know what's happening here. On prod, PropTypes get stripped out because it's not necessary in the traditional prod environment sense. Also, the babel-plugin-react-docgen doesn't run.

Am also facing this issue with static builds of storybook. Any suggested workarounds until a fix is put in?

Versions:
@storybook/react, @storybook/addon-info v.3.2.0

There's really no workaround unfortunately. I don't think you can use a custom .babelrc for static builds.

I'll fix it when I get a chance.

A custom .babelrc would only be employed on non-static builds?

@DanielJRutledge unfortunately, yes. I think I'm gonna add it into the prod babel config for now and refactor the function that takes the custom babelrc later.

Think this issue has been fixed when we refactored the server code to the core package.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sakulstra picture sakulstra  路  3Comments

tomitrescak picture tomitrescak  路  3Comments

tlrobinson picture tlrobinson  路  3Comments

wahengchang picture wahengchang  路  3Comments

xogeny picture xogeny  路  3Comments