@mdx-js_react.js does not provide an export named 'mdx' [Bug]
See original GitHub issueWhat version of vite
are you using?
2.9.9
System info and storybook versions
Environment Info:
System: OS: macOS High Sierra 10.13.6 CPU: (8) x64 Intel® Core™ i7-4870HQ CPU @ 2.50GHz Binaries: Node: 16.14.2 - /usr/local/bin/node Yarn: 3.2.0 - /usr/local/bin/yarn npm: 8.6.0 - /usr/local/bin/npm Browsers: Chrome: 101.0.4951.64 Edge: 101.0.1210.53 Firefox: 97.0.1 Safari: 13.1.2 NPM Packages
“dependencies”: { “vue”: “^3.2.25” }, “devDependencies”: { “@babel/core”: “^7.18.2”, “@mdx-js/react”: “^2.1.1”, “@storybook/addon-actions”: “^6.5.6”, “@storybook/addon-essentials”: “^6.5.6”, “@storybook/addon-interactions”: “^6.5.6”, “@storybook/addon-links”: “^6.5.6”, “@storybook/addon-postcss”: “^2.0.0”, “@storybook/builder-vite”: “^0.1.35”, “@storybook/testing-library”: “^0.0.11”, “@storybook/vue3”: “^6.5.6”, “@tailwindcss/forms”: “^0.5.2”, “@vitejs/plugin-vue”: “^2.3.3”, “autoprefixer”: “^10.4.7”, “babel-loader”: “^8.2.5”, “postcss”: “^8.4.14”, “tailwindcss”: “^3.0.24”, “vite”: “^2.9.9”, “vue-loader”: “^16.8.3” }
Describe the Bug
MDX files throw the following error in Storybook:
SyntaxError: The requested module '/node_modules/.vite-storybook/deps/@mdx-js_react.js?v=4345b16f' does not provide an export named 'mdx'
I am using Storybook inside an NPM workspace / Monorepo. If I install Storybook into a fresh project (outside the monorepo) I do not have this issue.
Any ideas?
Link to Minimal Reproducible Example
No response
Participation
- I am willing to submit a pull request for this issue.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:18 (7 by maintainers)
Top GitHub Comments
Sorry to reopen this issue but I’m getting this error and I’m using react v17 in my pnpm monorepo… I can’t get mdx to work with storybook…
Interesting. I think you can work around this for now with
npm i --save-dev @mdx-js/react@1 --force
.