Open
Description
Describe the bug
When building a Storybook with rolldown-vite
(here the plain react + ts example), it fails after the build because the globals can't be applied.
Reproduction
https://github.com/TheAlexLichter/rolldown-vite-reproductions/tree/storybook-globals
Steps to reproduce
After cloning the repo:
pnpm i
pnpm storybook:build
- Serve the storybook instance via
pnpm storybook:serve
- Open on
localhost:3000
- See error in the console
When running it via pnpm storybook:dev
things work as expected. Same without rolldown-vite
.
System Info
System:
OS: macOS 15.3.2
CPU: (12) arm64 Apple M2 Max
Memory: 95.63 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.15.0 - /usr/local/bin/node
Yarn: 1.22.22 - /opt/homebrew/bin/yarn
npm: 10.9.2 - /usr/local/bin/npm
pnpm: 10.10.0 - /opt/homebrew/bin/pnpm
bun: 1.0.30 - /opt/homebrew/bin/bun
Browsers:
Chrome: 136.0.7103.114
Safari: 18.3.1
npmPackages:
@vitejs/plugin-react: ^4.4.1 => 4.4.1
vite: ^6.3.5 => 6.3.5
Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs and the Rolldown-related guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.