Skip to content

fix(react-storybook-addon-export-to-sandbox): find the addon registration on Windows - #36671

Open
Ray Knight (ArrayKnight) wants to merge 1 commit into
microsoft:masterfrom
ArrayKnight:fix/storybook-sandbox-windows-path-36653
Open

fix(react-storybook-addon-export-to-sandbox): find the addon registration on Windows#36671
Ray Knight (ArrayKnight) wants to merge 1 commit into
microsoft:masterfrom
ArrayKnight:fix/storybook-sandbox-windows-path-36653

Conversation

@ArrayKnight

@ArrayKnight Ray Knight (ArrayKnight) commented Aug 31, 2026

Copy link
Copy Markdown

react-storybook-addon-export-to-sandbox locates its own registration by matching the registered preset name against a pattern that accepts forward slashes only. On Windows the registered preset name is an absolute path with backslashes (e.g. ...\react-storybook-addon-export-to-sandbox\temp\preset.ts), so the pattern matches nothing: the addon options are silently dropped and the full-source babel plugin crashes downstream on undefined importMappings. The failure is platform-specific and silent right up to the crash — Linux CI has never seen it — and it hits any contributor the first time they run a Storybook that registers this addon on Windows.

The fix widens addonFilePattern to accept either separator, with a comment explaining why both are there so it is not tidied back.

Fixes #36653.

Extracted from #36656 per maintainer request — each in-tree fix from that PR as an isolated change.

…tion on Windows

The addonFilePattern accepted forward slashes only, but on Windows the
registered preset name is an absolute path with backslashes, so the
pattern matched nothing: the addon options were silently dropped and the
full-source babel plugin crashed downstream on undefined importMappings.
Accept either separator, with a comment recording why.

Extracted from windmod branch commit 510b8c5 (webpack.ts hunk only).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Aj9uA3rCVgosnh2zNn8qkc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: react-storybook-addon-export-to-sandbox never finds its own registration on Windows

1 participant