[Bug] Missing package @mdx-js/react on scratch build sveltekit + storybook + builder-vite
See original GitHub issueWhat version of vite
are you using?
2.9.9
System info and storybook versions
System: OS: macOS 12.3.1 CPU: (10) arm64 Apple M1 Pro Binaries: Node: 18.0.0 - /opt/homebrew/bin/node npm: 8.9.0 - /opt/homebrew/bin/npm Browsers: Chrome: 101.0.4951.64 Firefox: 100.0 Safari: 15.4 npmPackages: @storybook/addon-actions: ^6.5.3 => 6.5.3 @storybook/addon-essentials: ^6.5.3 => 6.5.3 @storybook/addon-interactions: ^6.5.3 => 6.5.3 @storybook/addon-links: ^6.5.3 => 6.5.3 @storybook/builder-vite: ^0.1.35 => 0.1.35 @storybook/builder-webpack4: ^6.5.3 => 6.5.3 @storybook/manager-webpack4: ^6.5.3 => 6.5.3 @storybook/svelte: ^6.5.3 => 6.5.3 @storybook/testing-library: ^0.0.11 => 0.0.11
Describe the Bug
Created a scratch project with Sveltekit(1.0.0-next.335), storybook (6.5.3) and builder-vite. This project with webpack works fine.
But when starting storybook, I’m presented with the following error:
info => Ignoring cached manager due to change in manager config
ERR! Error: [vite-plugin-mdx] "@mdx-js/react" must be installed
ERR! at resolveImport (/Users/maximehuylebroeck/Documents/Development/storybook-load-API-data-via-loaders/node_modules/vite-plugin-mdx/dist/imports.js:29:23)
ERR! at Object.assertImportExists (/Users/maximehuylebroeck/Documents/Development/storybook-load-API-data-via-loaders/node_modules/vite-plugin-mdx/dist/imports.js:41:12)
ERR! at /Users/maximehuylebroeck/Documents/Development/storybook-load-API-data-via-loaders/node_modules/vite-plugin-mdx/dist/transform.js:18:19
ERR! at Array.map (<anonymous>)
ERR! at Object.createTransformer (/Users/maximehuylebroeck/Documents/Development/storybook-load-API-data-via-loaders/node_modules/vite-plugin-mdx/dist/transform.js:17:50)
ERR! at Object.configResolved (/Users/maximehuylebroeck/Documents/Development/storybook-load-API-data-via-loaders/node_modules/vite-plugin-mdx/dist/index.js:46:43)
ERR! at /Users/maximehuylebroeck/Documents/Development/storybook-load-API-data-via-loaders/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:61561:127
ERR! at Array.map (<anonymous>)
ERR! at resolveConfig (/Users/maximehuylebroeck/Documents/Development/storybook-load-API-data-via-loaders/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:61561:35)
ERR! at async getOptimizeDeps (/Users/maximehuylebroeck/Documents/Development/storybook-load-API-data-via-loaders/node_modules/@storybook/builder-vite/dist/optimizeDeps.js:127:28)
Link to Minimal Reproducible Example
https://github.com/GeForcez/storybook-load-API-data-via-loaders
Participation
- I am willing to submit a pull request for this issue.
Issue Analytics
- State:
- Created a year ago
- Comments:17 (8 by maintainers)
Top GitHub Comments
WOW! I SOLVED!
It seems like this only happens when you are on React 18?