-
Notifications
You must be signed in to change notification settings - Fork 106
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
Doesn't work in project that depends on MDX 2 #234
Comments
@bensmithett does storybook itself support MDX 2? I thought I heard the maintainers talking about adding support or troubleshooting it, but I could be wrong there. |
@IanVS I don't think so, this is the only really relevant thing I could find that seems to indicate they're sticking on 1 for now storybookjs/storybook#17455 (comment) |
Thanks for looking into that. Do you think we can close this issue until/unless MDX 2 is supported by storybook? |
@IanVS couple of reasons I don't think we should close this (but I have a personal interest in getting it working 😄 so take this with a grain of salt)
|
Ah I see, I misunderstood the original issue, thanks. I don't use MDX personally, so I'll need to rely on community members to step in here. |
I have this repository https://github.com/Stunext/docsBug with React 18 and MDX2... I have this error in the console:
This happens in mdx files. The root of this error can be seen in the source tab at the line:
I think it's important not to close this issue because mdx2 will be the base for storybook 7. Even mdx2 has support for @mdx-js/esbuild and @mdx-js/rollup. mdx1.x use this sintax:
Instead, mdx2 uses:
Migration instructions here https://mdxjs.com/migrating/v2/ |
Thanks @Stunext. I think we need to check for the
|
I've spent some time digging into this, and made some progress. The main issue right now is that the |
Fixes #234 Fixes #391 Fixes #398 To enable experimental MDX2 in a project, follow this guide: https://gist.github.com/shilman/6ff2d7e18db8846e8fc552fb432ae4f6 * Support MDXv2 * Fix formatting * Remove explicit mdx-js/preact from example * Remove workarounds from readme * Add @storybook/mdx2-csf to examples using it Co-authored-by: Ian VanSchooten <ian.vanschooten@gmail.com>
I have a project that I'm trying to upgrade to MDX 2 (where I use MDX outside of Storybook)
🐞 Minimal reproduced test case here
After yarn installing, my
node_modules
looks like this:I think that should be fine. storybook-builder-vite and vite-plugin-mdx should find 1.6.22 because dependency resolution.
But vite-plugin-mdx is actually attempting to load 2.0.0 from the root
node_modules
, and exploding because it's not finding the expected commonjs export from 1.6.22:If I
yarn remove @mdx-js/mdx
(so the only one left in the project is the one you're depending on) everything works.I don't know anything about Vite plugins or Storybook builders to know where to start on this one.
I know vite-plugin-mdx isn't this repo, but I could only reproduce the error when I coupled it with a storybook setup like this.
Cheers!
The text was updated successfully, but these errors were encountered: