Skip to content

Upgrade Storybook past 10.5.6, where decorator args lose their types #1619

Closed

Description

@joshunrau

storybook, @storybook/addon-docs, @storybook/addon-themes and @storybook/react-vite are pinned to exactly 10.5.6 in the catalog by the dependency update on the deps branch. The newest release eligible under the repo's 7-day minimumReleaseAge on 2026-10-04 was 10.6.0.

Why it was not upgraded

From 10.5.7 on, tsc fails in apps/playground:

src/components/FileUploadDialog/FileUploadDialog.stories.tsx(29,24): error TS7006: Parameter 'files' implicitly has an 'any' type.
src/components/FileUploadDialog/FileUploadDialog.stories.tsx(61,26): error TS7006: Parameter 'files' implicitly has an 'any' type.

Both failures are callbacks, onSubmit(files) and onValidate(files), in the args passed to <Story args={…} /> inside a decorator.

  • Up to 10.5.6, those args get their types from FileUploadDialogProps. From 10.5.7 they do not.
  • The bisect ran on a fresh lockfile at each step, with the addons and the core on the same version:
    • pass: 10.4.2, 10.4.6, 10.5.0, 10.5.5, 10.5.6
    • fail: 10.5.7, 10.5.8, 10.5.10, 10.6.0
  • The 10.5.7 release notes mention nothing typing-related, so the cause is not identified.
  • No matching upstream issue was found.

When the addons and the storybook core peer resolve to different versions, the error disappears. Any bisect has to keep them aligned.

What is required

Either:

  • find what changed in 10.5.7's published types (@storybook/react or storybook/internal/types) and report it upstream if it is a regression, or
  • annotate the two callbacks (onSubmit(files: File[]), onValidate(files: File[])) and accept the looser typing of decorator args.

Then move the four catalog entries back to a caret range and run pnpm lint, which type-checks every story.

Activity

  1. added
    Priority: Low
    Difficulty: Low
    Chore
    Area: Playground
    Area: Infrastructure
    Upstream
    on Oct 5, 2026
  2. joshunrau commented on Oct 26, 2026

    @joshunrau
    CollaboratorAuthor

    Fixed by f98c865 in #1660, which is still open (CONFLICTING, last updated 2026-10-07). main (d86740e) still pins all four packages to 10.5.6 (pnpm-workspace.yaml:49-52).

    Cause

    Storybook's declaration build changed in 10.5.7. The storybook 10.5.6 tarball has no dist/chunk-*.d.ts. 10.5.7 has 18, and its declarations contain 166 import("@storybook/react").Args / .Parameters references. storybook lists @storybook/react in neither dependencies nor peerDependencies. 10.6.3, the current latest, still has 165.

    Upstream tracks it as storybookjs/storybook#36630, opened 2026-10-06. The fix PR, storybookjs/storybook#36639, adds **/__for-testing__/** to the core declaration excludes. It is open, has no review, and was labelled Stale on 2026-10-20.

    Here, the hoisted node_modules/.pnpm/node_modules/@storybook/react is the variant paired with the storybook workspace's own react@19.1.0 (catalog:react19). That react ships no types, and root package.json deletes @types/react (L70). TypeScript then checks the stories against that copy instead of the one paired with vendor/react@19.x. f98c865's message has the full chain.

    Corrections

    Notes for landing

    Triage note written with Claude Code. Code references point at main @ d86740e.

  3. added a commit that references this issue on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: InfrastructureArea: PlaygroundChoreDifficulty: LowPriority: LowUpstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions