You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using rolldown-vite with Storybook v10 and @storybook/addon-docs, the built Storybook fails at runtime with ReferenceError: __STORYBOOK_MODULE_*__ is not defined.
What I expect: Built Storybook loads without errors, same as with standard Vite.
What actually happens: Console errors on page load:
Uncaught ReferenceError: __STORYBOOK_MODULE_CORE_EVENTS_PREVIEW_ERRORS__ is not defined
at csf-BrJoaeT2.js:4:13387
or
Uncaught ReferenceError: __STORYBOOK_MODULE_CLIENT_LOGGER__ is not defined
at instrumenter-LwmSDSR-.js:48:53
Observations:
Only affects built Storybook (dev mode works fine)
Only happens when @storybook/addon-docs is enabled (other addons work fine). Might not be related to this addon speicifically, since another smaller repo with it works, but I guess it happens in some cases due to chunking/code splitting.
Standard Vite does NOT have this issue - only rolldown-vite
I noticed a csf-*.js chunk (~149KB) appears in rolldown-vite builds but not in standard Vite builds - this might be related to differences in code splitting behavior
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
When using
rolldown-vitewith Storybook v10 and@storybook/addon-docs, the built Storybook fails at runtime withReferenceError: __STORYBOOK_MODULE_*__ is not defined.What I expect: Built Storybook loads without errors, same as with standard Vite.
What actually happens: Console errors on page load:
or
Observations:
@storybook/addon-docsis enabled (other addons work fine). Might not be related to this addon speicifically, since another smaller repo with it works, but I guess it happens in some cases due to chunking/code splitting.csf-*.jschunk (~149KB) appears in rolldown-vite builds but not in standard Vite builds - this might be related to differences in code splitting behaviorReproduction
https://github.com/bengry/rolldown-vite-storybook-globals-bug
Steps to reproduce
Clone the repo and install:
git clone https://github.com/bengry/rolldown-vite-storybook-globals-bug cd rolldown-vite-storybook-globals-bug yarn installBuild Storybook:
Serve the built output:
Open browser and check devtools console - you'll see the ReferenceError
System Info
Used Package Manager
yarn
Logs
Click to expand!
Validations