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
React + Storybook - Props are missing / types of props are missing in docs when running with Nx #7544
Comments
Hi there @danr-za ! Thanks for filing an issue and also for providing a reproduction repo! This is what I see when I run
what would the expected behavior be? |
Hey @mandarini, thanks for taking a look. This is the result you'll see, which differs from the one you run with nx (all button props with their types are displayed): |
@mandarini any news regarding this one? |
Hi @danr-za ! Will get into it soon, sorry about that!! |
Hi there @danr-za ! First of all, sorry for taking this long to get to this. Since it was not a blocking issue, and other blocking issues came up, I left this behind :( Thanks for understanding. So, of course, in order to fix this and see all the props, you can add the missing props manually on the story, and they will show up.
However, you are totally correct, it's weird that the pure Storybook server assumes the props correctly from the component, and our wrapper does not. So it's an omission, and we'll find a way to fix this. Another question (not related to above bug) would be: do you believe that it would make sense for Nx to read all props and add all of them in the generated story automatically? |
Hey @mandarini Regarding your question - totally. In our repo, I have created a generator that creates a component together with a story with all the "common" props already populated in args. 😄 |
@danr-za Yes yes, I see what you're saying. We'll get to it, eventually, I promise, hehe! :) Ha, it's nice you created your own generator to get around this, ha! :) Let me know if you'd like to help enhancing the Nx code to read the missing props, btw. We're open to contributions! |
Hi, barging in here to give the issue a bump and confirm that the build executor has the same behaviour. |
Hi there @pataroka ! Yes, we are aware. I'm looking into it to understand why. You can try to debug as well, if you want to help... Something in the options that are passed gets written over or something. |
@mandarini I compared the webpack config of both builds and it seems that the nx is missing a plugin. Cant't tell which one as converting this to JSON removes the plugin names. Don't know if it's relevant, but it's worth a try. Attached are the two config exports. |
Thank you!!!! |
You can clone this repository and run |
@mandarini Latest 13 or latest 14 version? |
Oh! Latest 14! |
@mandarini This still does not work for me. First, after migration, without updating the storybook dependencies to ^6.5.6 the sotorybook dev server fails to build
|
Hmm very interesting. I will look into it. In the meantime, can you share a repository which I can clone and play around? It would be super helpful. Also, can you run |
Hi there @pataroka ! If you remove the first line of your component, Can you try this out and let me know? I just tried it locally and it seems to work. I don't know why yet, I will investigate eventually. Until then, you can remove that import and the magic will happen. Here's my repository that shows it works. Here is your file, this repo has a bunch of other things I'm testing, too. That's with the latest version of Nx. |
Hey, @mandarini, thanks for looking at this so quickly. Here's the report:
Removing the import works, but I still need to push the storybook dependencies up to 6.5.6 - the 6.4.22 which comes with nx 14.1.9 fails to build. |
In my repo, which I shared above, I still use Storybook In any case, the next version of Nx will install Storybook Let me know if your issue remains unsolved! |
Oh, and please look at the repo I posted, maybe it helps! |
I think our build problem is related to this issue storybookjs/storybook#15336 |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
nx run lib:storybook
- Not all component props are displayed in Docs, both with CSF and MDXstart-storybook
- Works as expectedExpected Behavior
Should be as same as Storybook's result.
Steps to Reproduce
nx run ui:storybook
- Go to Button docs and see that not all props are displayed, and the ones that are displayed, don't have types.cd libs/ui && start-storybook
- Go to Button docs and see all props are displayed with types as expected.Environment
The text was updated successfully, but these errors were encountered: