Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Smartknobs is not showing up, what am I missing? #37

Open

Description

Currently

I'm taking the example provided in the README.md adding on it import '@storybook/addon-actions' or gonna fail asking for it.

import React, { PropTypes } from 'react'
import { storiesOf } from '@storybook/react'
import { withKnobs } from '@storybook/addon-knobs'
import '@storybook/addon-actions';
import { withSmartKnobs } from 'storybook-addon-smart-knobs'

const Button = ({ children, onClick }) => (
  <button onClick={ onClick }>{ children }</button>
)

Button.propTypes = {
  children: PropTypes.node,
  onClick: PropTypes.func
}

storiesOf('Button')
  .addDecorator(withSmartKnobs)
  .addDecorator(withKnobs)
  .add('simple', () => <Button>Smart knobed button</Button>)

Here's my package.json dep and devDep

  "dependencies": {
    "prop-types": "^15.6.2",
    "react": "^16.6.3",
    "react-dom": "^16.6.3"
  },
  "devDependencies": {
    "@babel/core": "^7.2.0",
    "@storybook/addon-actions": "^4.0.12",
    "@storybook/addon-knobs": "^4.0.12",
    "@storybook/react": "^4.0.12",
    "babel-loader": "^8.0.4",
    "storybook-addon-smart-knobs": "^3.3.1"
  }

Issue

image

Activity

  1. mahmoud-zakria-sociomantic commented on Dec 11, 2018

    @mahmoud-zakria-sociomantic
    Author

    Used import PropTypes from prop-types instead of react solved it, but no addon/propValues controllers show up.

    image

    import React from 'react';
    import PropTypes from 'prop-types';
    

    Also you need to add module as a second argument of storiesOf or you will lose HMR functionality.

    image

  2. ndelangen commented on Dec 12, 2018

    @ndelangen
    Contributor

    You didn't register the addon(s).
    In order to use smart knobs, you have to be using knobs, which needs to be registered:

    https://github.com/storybooks/storybook/tree/next/addons/knobs#getting-started

  3. mahmoud-zakria-sociomantic commented on Dec 13, 2018

    @mahmoud-zakria-sociomantic
    Author

    I've already registered it in .storybook/addons.js, but nothing.
    Here are my screenshots

    image

    And here's my code

    image

    Note: I'm using Babel7.
    image

  4. ndelangen commented on Dec 13, 2018

    @ndelangen
    Contributor

    I published 4.0.0

    I upgraded all dependencies to the latest

    This package is now storybook 4.x.x compatible.
    I'm assuming the problem you were facing was a mismatch of versions, since you code you posted is fine.

    Please let me know if this resolves the issue 👌

  5. mahmoud-zakria-sociomantic commented on Dec 13, 2018

    @mahmoud-zakria-sociomantic
    Author

    Thanks man, but no :( :(.

    image

  6. ndelangen commented on Dec 13, 2018

    @ndelangen
    Contributor

    @mahmoud-zakria-sociomantic if you run the storybook in this repo, does it show up then?

    What differences are there between the example in this repo and your setup?

  7. mahmoud-zakria-sociomantic commented on Dec 13, 2018

    @mahmoud-zakria-sociomantic
    Author

    @ndelangen
    No, I'm taking the whole example without putting any code of mine.
    Does it work for you?

  8. mahmoud-zakria-sociomantic commented on Dec 13, 2018

    @mahmoud-zakria-sociomantic
    Author

    Renamed to Smartknobs is not showing up

  9. changed the title [-]Can't read property 'node' of undefined msg[/-] [+]Smartknobs is not showing up[Renamed][/+] on Dec 13, 2018
  10. ndelangen commented on Dec 13, 2018

    @ndelangen
    Contributor

    Yeah the example in the codebase is working on my machine.. 😕

  11. ndelangen commented on Dec 14, 2018

    @ndelangen
    Contributor

    @mahmoud-zakria-sociomantic Can you share a repo that has this problem so I can debug?

  12. mahmoud-zakria-sociomantic commented on Dec 14, 2018

    @mahmoud-zakria-sociomantic
    Author
  13. mahmoud-zakria-sociomantic commented on Dec 14, 2018

    @mahmoud-zakria-sociomantic
    Author

    Node version: 8.11.4
    Yarn version: 1.7
    OS: macOS High Sierra v10

  14. mahmoud-zakria-sociomantic commented on Dec 17, 2018

    @mahmoud-zakria-sociomantic
    Author

    @ndelangen Is it working with you?

  15. mahmoud-zakria-sociomantic commented on Dec 19, 2018

    @mahmoud-zakria-sociomantic
    Author

    @ndelangen , I've tried the below updates and still no knobs

    "@storybook/addon-actions": "^4.1.2",
    "@storybook/addon-knobs": "^4.1.2",
    "@storybook/react": "^4.1.2",
    "babel-loader": "^8.0.4",
    "storybook-addon-smart-knobs": "^4.1.0"

  16. 1 remaining item

  17. melMass commented on Jan 10, 2019

    @melMass

    You didn't register the addon(s).
    In order to use smart knobs, you have to be using knobs, which needs to be registered:

    storybooks/storybook:addons/knobs@next#getting-started

    This should be in the readme

  18. melMass commented on Jan 10, 2019

    @melMass

    I'm getting:

    Cannot find module 'storybook-addon-smart-knobs/register'

  19. mahmoud-zakria-sociomantic commented on Jan 14, 2019

    @mahmoud-zakria-sociomantic
    Author

    @melMass it has to be import '@storybook/addon-knobs/register';

  20. changed the title [-]Smartknobs is not showing up[Renamed][/-] [+]Smartknobs is not showing up[/+] on Jan 18, 2019
  21. changed the title [-]Smartknobs is not showing up[/-] [+]Smartknobs is not showing up, what am I missing?[/+] on Jan 18, 2019
  22. azz0r commented on Feb 1, 2019

    @azz0r

    Also getting this issue but no errors that allude to a problem

  23. mahmoud-zakria-sociomantic commented on Feb 1, 2019

    @mahmoud-zakria-sociomantic
    Author

    @azz0r I'm following them on Slack they are going to handle it after releasing v5.
    https://storybooks.slack.com/archives/C1ZN32SKW/p1547805319034200

  24. anand-neema commented on Feb 24, 2019

    @anand-neema

    @mahmoud-zakria-sociomantic Is there any estimation on resolving this issue ? And when they are planning for V5

  25. shilman commented on Feb 24, 2019

    @shilman
    Contributor

    We're scheduled to release v5 in a week or so but there will be a lot of v5 support after the release and we've pushed a lot to post-v5 so frankly I wouldn't wait on this. AFAIK plain knobs are working great

  26. ndelangen commented on Feb 24, 2019

    @ndelangen
    Contributor

    PLain knobs IS working, this code in the addon is working, it's the generation of the needed data from propTypes/ types that is not working and causing the knobs to not show up.

  27. anand-neema commented on Apr 18, 2019

    @anand-neema

    @shilman is there any estimation to resolve this issue ? So that all nobs will work on the basis of proptypes/flowTypes

    can you please update the planning to fix this , so that we can proceed accordingly .

  28. shilman commented on Apr 18, 2019

    @shilman
    Contributor

    like i said above, addon-knobs is working great. until somebody picks this up, i wouldn't hold my breath. you're welcome to contribute and then you'll know exactly the schedule!

  29. hugomassing commented on Sep 5, 2019

    @hugomassing

    Any update on this?

  30. EscoCreeks commented on Jan 10, 2020

    @EscoCreeks

    Hello, I have deep dived on the issue, and I think we have to upgrade this library to check props from propTypes instead of genDoc, which is (even when having the plugin at the right place) not working.

    I've found that addon-info is working like a charm with the PropTable, correctly displaying each props with their type. In its code it can either fetch this data from genDoc or directly from the propTypes.

    I'll try to push a PR this week-end to fix this if people are still interested.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions