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

Docs addon propType description broken when using CRA and emotion's jsx pragma #9150

Closed
jscheel opened this issue Dec 14, 2019 · 10 comments
Closed
Labels
block: props cra Prioritize create-react-app compatibility question / support

Comments

@jscheel
Copy link

jscheel commented Dec 14, 2019

When using the jsx pragma for the css prop from emotion, storybook's docs addon does not render propType descriptions.

Here is a repo that reproduces the issue:
https://github.com/jscheel/storybook-cra-emotion-jsx-pragma

The repo provides a working and broken example. In the working example (NormalExample), the description column of the prop table is generated properly. In the broken example (EmotionExample), the description column is blank.

If I kill the create-react-app config (easiest way is to just npm remove react-scripts), everything works as expected in both examples.

System:

Environment Info:

  System:
    OS: macOS Sierra 10.12.5
    CPU: (8) x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
  Binaries:
    Node: 12.13.0 - /var/folders/27/fqmq58ks6kzbkmmgg7whv4280000gn/T/fnm-shell-2901125/bin/node
    Yarn: 1.13.0 - ~/.yarn/bin/yarn
    npm: 6.12.0 - /var/folders/27/fqmq58ks6kzbkmmgg7whv4280000gn/T/fnm-shell-2901125/bin/npm
  Browsers:
    Chrome: 79.0.3945.79
    Firefox: 70.0.1
    Safari: 10.1.1
  npmPackages:
    @storybook/addon-actions: ^5.2.8 => 5.2.8
    @storybook/addon-docs: ^5.2.8 => 5.2.8
    @storybook/addon-links: ^5.2.8 => 5.2.8
    @storybook/addons: ^5.2.8 => 5.2.8
    @storybook/react: ^5.2.8 => 5.2.8

Normal, Working Example:
normal

Broken, Emotion Example:
emotion

@shilman shilman added block: props cra Prioritize create-react-app compatibility question / support labels Dec 14, 2019
@shilman
Copy link
Member

shilman commented Dec 14, 2019

Thanks for the repro, although it doesn't work for me out of the box. Did you test it?

It complained about not having @storybook/addon-knobs installed, so I installed it.

After that, I tried to install the preset-create-react-app standalone preset, which I expect would fix the problem:

https://www.npmjs.com/package/@storybook/preset-create-react-app

However, it gave me a babel error. @mrmckeb can you take a look?

@jscheel
Copy link
Author

jscheel commented Dec 14, 2019

I’ll attach some screenshots in a bit

@jscheel
Copy link
Author

jscheel commented Dec 14, 2019

@shilman ok, I've updated the repo with the missing package. I was deleting some unused packages before committing and accidentally took out @storybook/addon-knobs.

I've added screenshots of each example in my repo and here so you can see the problem.

I also tried preset-create-react-app and had issues as well.

@mrmckeb
Copy link
Member

mrmckeb commented Dec 15, 2019

I'm unable to test this as I'm hitting this issue... inspect-js/is-set#3.

You also should be able to skip the babel.config.js file, as we load the required config from CRA.

@hckhanh
Copy link

hckhanh commented Dec 16, 2019

I get the same issue when I try to upgrade Storybook. My props are not displayed properly anymore. It does not show any props.

@shilman
Copy link
Member

shilman commented Dec 16, 2019

i think this is the underlying issue: storybookjs/presets#78

will try to work through that, and then look into the emotion issue after it's resolved. thanks for your patience!

@shilman
Copy link
Member

shilman commented Dec 16, 2019

Fixed in @storybook/[email protected]!! Please upgrade and try it out! Thanks @mrmckeb for the fix 🙌

Then we can get back to the original issue about jsx pragma 😉

@stale
Copy link

stale bot commented Jan 6, 2020

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. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Jan 6, 2020
@stale
Copy link

stale bot commented Feb 5, 2020

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

@stale stale bot closed this as completed Feb 5, 2020
@shilman shilman reopened this Feb 5, 2020
@stale stale bot removed the inactive label Feb 5, 2020
@mrmckeb
Copy link
Member

mrmckeb commented Feb 11, 2020

Can this issue be closed? It appears to have been resolved.

@shilman shilman closed this as completed Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
block: props cra Prioritize create-react-app compatibility question / support
Projects
None yet
Development

No branches or pull requests

4 participants