Skip to content

Storybook Globals are not applied when using rolldown-vite #182

Open
@TheAlexLichter

Description

@TheAlexLichter

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:

  1. pnpm i
  2. pnpm storybook:build
  3. Serve the storybook instance via pnpm storybook:serve
  4. Open on localhost:3000
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: upstreamBug in a dependency of Vite

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions