Skip to content

[Bug] peerDependencies admit storybook 9.1.x, where the preset fails to load and the components manifest does not exist in core #376

Description

@rachelslurs

What happened

I added @storybook/addon-mcp@0.7.0 to a clone of radix-ui/primitives (commit df8f89ac, apps/storybook, storybook 9.1.20). The install succeeded: the published peer range ^0.0.0-0 || ^9.1.16 || ^10.0.0 || ^10.1.0-0 || ^10.2.0-0 || ^10.3.0-0 || ^10.4.0-0 || ^10.5.0-0 admits 9.1.20. storybook build then failed while loading presets:

Error [ERR_INTERNAL_ASSERTION]: Unexpected module status 0

That error masks the cause. Importing the preset directly exposes it:

SyntaxError: The requested module 'storybook/internal/common' does not provide an export named 'importModule'

dist/preset.js imports importModule from storybook/internal/common, and storybook 9.1.20 does not export it. importModule appears nowhere in 9.1.20's dist/common/index.js or index.cjs, while the preset's other import from the same module, normalizeStoryPath, is present.

Fixing the import would not be enough on 9.1.x

The manifest feature is absent from storybook core on the 9.1 line under both of its flag spellings. Grep counts over the published storybook dist tarballs, occurrences anywhere in dist:

storybook componentsManifest experimentalComponentsManifest importModule in dist/common
9.1.17 0 0 0
9.1.20 0 0 0
10.0.0, 10.0.8 0 0 2
10.1.0, 10.1.10, 10.1.11 0 3 2
10.2.0, 10.2.10, 10.2.14, 10.2.19 0 3 2
10.3.0 7 0 2

The feature enters core at 10.1.0 under the experimental spelling, and the stable spelling replaces it at 10.3.0. On 9.1.x neither spelling exists, so the ^9.1.16 floor admits a version line where the preset cannot load and, with the import fixed, would find no manifest feature to use. Builds confirm the table at three points: the preset fails to load at 9.1.20, and storybook build writes storybook-static/manifests/components.json with the addon alone at 10.3.5 and 10.4.2, and with the addon plus features: { componentsManifest: true } at 10.5.3. I have not tested whether the addon produces a manifest on the 10.1 to 10.2 band with the experimental flag.

Reproduction

  1. git clone https://github.com/radix-ui/primitives and check out df8f89ac
  2. pnpm install
  3. pnpm --dir apps/storybook add -D @storybook/addon-mcp@0.7.0
  4. Add '@storybook/addon-mcp' to the addons array in apps/storybook/.storybook/main.ts
  5. pnpm --dir apps/storybook run build

Fails during preset loading. Reproduced on Node 22.20.0 and Node 24.14.0 (the repo's .nvmrc pins 24), macOS, pnpm 11.5.0.

Expected

Either the peer floor matches a version line the addon works on (10.3.x through 10.5.x is demonstrated; 10.1 to 10.2 carries only the experimental flag and is untested), or the preset fails on 9.1.x with a message naming the minimum version. Every published version from 0.1.4 through 0.7.0, prereleases included, carries the ^9.1.16 floor, and 0.0.9 was looser still at >=9.0.0, so pinning an older addon does not avoid this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions