question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] 'mdx' is not exported by node_modules/@mdx-js/react/index.js

See original GitHub issue

What version of vite are you using?

2.9.13

System info and storybook versions

Environment Info:

System: OS: Linux 5.15 Ubuntu 22.04 LTS 22.04 LTS (Jammy Jellyfish) CPU: (8) x64 Intel® Core™ i7-2600 CPU @ 3.40GHz Binaries: Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node Yarn: 1.22.19 - /usr/bin/yarn npm: 8.13.1 - /media/fr/fr-work/Sites/dora/dora-front/node_modules/.bin/npm npmPackages: @storybook/addon-docs: ^6.5.9 => 6.5.9 @storybook/addon-essentials: ^6.5.9 => 6.5.9 @storybook/addon-links: ^6.5.9 => 6.5.9 @storybook/builder-vite: ^0.1.38 => 0.1.38 @storybook/mdx2-csf: ^0.0.3 => 0.0.3 @storybook/svelte: ^6.5.9 => 6.5.9

Describe the Bug

In a svelte project, there is the error : 'mdx' is not exported by node_modules/@mdx-js/react/index.js.

I installed @storybook/mdx2-csf and @mdx-js/react. (not sure if this is necessary)

Thank you

Link to Minimal Reproducible Example

No response

Participation

  • I am willing to submit a pull request for this issue.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:29 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
francoisromaincommented, Jun 30, 2022

if I don’t install @mdx-js/react, there is this error:

[vite]: Rollup failed to resolve import "@mdx-js/react" from "src/Introduction.stories.mdx".
1reaction
bodograumanncommented, Aug 8, 2022

With the help of @IanVS , I managed to find two viable workarounds:

  • explicitely install react@^17 and react-dom@^17, or alternatively
  • update to the MDX2 preview and explicitely install @mdx-js/react@^2.
Read more comments on GitHub >

github_iconTop Results From Across the Web

mdx-js_react.js does not provide an export named 'mdx' [Bug]
I am using Storybook inside an NPM workspace / Monorepo. If I install Storybook into a fresh project (outside the monorepo) I do...
Read more >
MDX not exporting/importing js files as expected
This issue was in the way I imported. I simply changed import { Test2 } from "../pages/test2" <Test2 />. to import Test2 from...
Read more >
Troubleshooting MDX
The reason for this error is that the parser is expecting a JavaScript import or export statement. If you want the word import...
Read more >
Solving "NAME is not exported by MODULE" When Using ...
It seems to be an incompatibility with a tool called Rollup (used for packaging our Javascript modules into a single application) and the...
Read more >
Storybook Docs 6.1.1 not able to set components ... - Issuehunt
Describe the bug After upgrading from 6.0.25 Storybook Docs no longer recognizes ... was not imported, exported, or provided by MDXProvider as global...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found