Skip to content

[Bug]: Stories glob should exclude node_modules #32835

@shilman

Description

@shilman

Describe the bug

Encountered the following bug upgrading HeroUI from SB8 to SB9.

The following line:

https://github.com/shilman/heroui/blob/328c57d8ea4d27306a7001bb702a1c018953ed0c/packages/storybook/.storybook/main.ts#L8

Had to be modified to:

https://github.com/shilman/heroui/blob/07928b4669e39b270d4a694684aee7c3b5f5e52b/packages/storybook/.storybook/main.ts#L8

Because SB9 was picking up stories from node_modules. This is a common pattern and an unintentional breaking change in SB9.

Reproduction link

https://github.com/shilman/heroui/

Reproduction steps

First:

pnpm install
pnpm run sb

Then revert the change to main.ts and

pnpm run sb

System

Storybook Environment Info:

  System:
    OS: macOS 15.7.1
    CPU: (10) arm64 Apple M1 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.20.0 - /usr/local/bin/node
    npm: 10.9.3 - /usr/local/bin/npm
    pnpm: 10.6.2 - ~/Library/pnpm/.tools/pnpm/10.6.2/bin/pnpm <----- active
  Browsers:
    Chrome: 141.0.7390.123
    Safari: 26.0.1
  npmPackages:
    @storybook/addon-a11y: ^9.1.15 => 9.1.15 
    @storybook/addon-docs: ^9.1.15 => 9.1.15 
    @storybook/addon-links: ^9.1.15 => 9.1.15 
    @storybook/cli: ^9.1.15 => 9.1.15 
    @storybook/react-vite: ^9.1.15 => 9.1.15 
    storybook: ^9.1.15 => 9.1.15

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions