Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.3.0-alpha.0] addinfo throws prettyPropType error #1880

Closed
eddiemonge opened this issue Sep 21, 2017 · 10 comments
Closed

[3.3.0-alpha.0] addinfo throws prettyPropType error #1880

eddiemonge opened this issue Sep 21, 2017 · 10 comments

Comments

@eddiemonge
Copy link
Contributor

eddiemonge commented Sep 21, 2017

After upgrading to 3.3.0-alpha.0, I get the following message:

warning.js:35 Warning: Failed prop type: Invalid prop `propType` of type `string` supplied to `PrettyPropType`, expected `object`.
    in PrettyPropType (created by PropTable)
    in PropTable (created by Story)
    in div (created by Story)
    in div (created by Story)
    in div (created by Story)
    in div (created by Story)
    in div (created by Story)
    in div (created by Story)
    in Story

Seems to come from my .storybook/config.js file:

import { withInfo } from '@storybook/addon-info'

addDecorator((story, context) => withInfo({})(story)(context))
@danielduan
Copy link
Member

danielduan commented Sep 26, 2017

I haven't seen the info addon documented or used like this as a decorator. I'm wondering if that's supported or not..

edit: just realized how vague that sounded. I think it should be withInfo('string here')
https://github.com/storybooks/storybook/tree/master/addons/info#usage-as-decorator

@eddiemonge
Copy link
Contributor Author

That seems to fix it. The usage seems to have changed. That should make it a breaking change though

@shilman
Copy link
Member

shilman commented Sep 26, 2017

@eddiemonge please double check but i think addDecorator((story, context) => withInfo({ text: 'string here' })(story)(context)) should also work. i think the issue in your code above is that you are passing in neither a string nor an object with a text field of type string. also, i don't think the usage has changed (other than the 3.2 change of .addWithInfo being deprecated (still supported, but will i'm hoping we drop it in 4.0). please lmk if that all makes sense 😬

@eddiemonge
Copy link
Contributor Author

Changed it to

addDecorator((story, context) => withInfo(
  'Global Components'
)(story)(context))

and it still throws the warning. Part of the problem is the debug output is not helpful. It doesn't give line numbers or anything useful.

in PrettyPropType (created by PropTable)
          in PropTable (created by Story)
          in div (created by Story)

doesn't provide any context

@shilman
Copy link
Member

shilman commented Sep 26, 2017

@eddiemonge curious whether you've tried this in 3.2.11? it's also very possible that something broke in the 3.3 branch. if so, i can def look into it. sorry for the hassle!

@eddiemonge
Copy link
Contributor Author

@storybook/react@3.2.11 no warning.

@stale
Copy link

stale bot commented Nov 11, 2017

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. We do try to do some housekeeping every once in a while so inactive issues will get closed after 60 days. Thanks!

@stale stale bot added the inactive label Nov 11, 2017
@eddiemonge
Copy link
Contributor Author

Still an issue in 3.3.0-alpha.3

@stale stale bot removed the inactive label Nov 13, 2017
@danielduan
Copy link
Member

this will probably be a part of #2196 since it shows up in our jest tests.

@danielduan
Copy link
Member

Think this has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants