Skip to content

IanVS/storybook-9-rolldown-issue

Repository files navigation

Issue with Storybook 9 and Rolldown-Vite

I recently updated to Storybook 9 and in parallel started using rolldown-vite. I found that storybook 9 worked fine before updating to rolldown-vite, and storybook 8 works fine with rolldown-vite, but the combination caused problems.

Cause/trigger

I've narrowed at least one of the issues down to using a render function that renders a component that imports from import '@storybook/react-vite'.

Reproduction

To reproduce:

  1. pnpm build-storybook
  2. pnpm dlx http-server storybook-static --port 6006 --silent
  3. Navigate to http://localhost:6006/?path=/story/repro--default
  4. Open the console, see the error: chunk-N3U7HZRZ-DqlWfFHk.js:2 Uncaught ReferenceError: __STORYBOOK_MODULE_PREVIEW_API__ is not defined
  5. Open helper.tsx, comment out import.
  6. Rebuild storybook
  7. Refresh the storybook browser tab (make sure to clear cache)
  8. It should now load fine

About

Reproduction of an issue with storybook 9 and vite-rolldown

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published