-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Addon-docs : Source-loader warning when using CSF Stories with MDX Docs #8885
Comments
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! |
@donaldpipowitch what do you think we should do about the warning in this case? I believe this is a valid recipe, but this snippet does NOT pass the context into the story, thus triggering the warning you added:
cc @tmeasday |
Did we talk about other ways of expressing this? Like <Story name="Basic" render={stories.basic} /> |
Not sure, I have to look at this. Without the story context the source-loader can't do anything meaningful, right? So maybe excluding the files from the loader would be the best workaround for now. 🤔 Maybe we need a better way to determine what IS a story? So that the loader isn't applied accidentally to non-stories. |
I changed the title of the issue because it was misguiding, referencing "CSF with arbitrary MDX" recipe instead of "CSF with MDX Docs" one (as I have played with both). In my current working case I ended up using arbitrary MDX as it was closer to the goal I wanted to achieve (having stories declared in CSF for development and MDX for custom documentation). But the issue is still valid as is, in fact there is even more : I've recently update to storybook 5.3.0-rc.11 and now the recipe produce an error (see screenshot below). If we remove I made a repo for reproduction : https://github.com/MatthisLT/storybook-cases/tree/8885, with installation instructions in the Readme, hope it helps. |
Hi! I am going through and cleaning up old issues in the repo. We just shipped a ton of improvements in Storybook 7.0, and I suspect this bug might be fixed already. Can you please try it out? If this issue persists with the latest version, please open a new bug report with a 7.x reproduction. Thank you so much! 🙏🏼 |
Describe the bug
Source-loader produce warnings in the console when trying to use the following recipe : CSF Stories with MDX Docs.
The warning is raised when using :
<Story name="basic">{stories.basic()}</Story>
.To Reproduce
npm run storybook
Expected behavior
There should be no warning in the console when using this recipe. Or more explication on the expected config in this last.
Screenshots
The resulting warning :
Code snippets
Button.js
Button.stories.js
Button.stories.mdx
System:
Additional context
The warning was introduced with PR #8773.
The text was updated successfully, but these errors were encountered: