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] Missing package @mdx-js/react on scratch build sveltekit + storybook + builder-vite

See original GitHub issue

What 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:closed
  • Created a year ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
dohooocommented, May 27, 2022

WOW! I SOLVED!

image
4reactions
openscriptcommented, May 23, 2022

It seems like this only happens when you are on React 18?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using vite plugins with Storybook and SvelteKit - Stack Overflow
When importing SVG files inside a SvelteKit route, a Svelte component is returned as it should be. I have tried this with Storybook...
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