fix(react-storybook-addon-export-to-sandbox): find the addon registration on Windows - #36671
Open
Ray Knight (ArrayKnight) wants to merge 1 commit into
Open
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
react-storybook-addon-export-to-sandboxlocates 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 undefinedimportMappings. 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
addonFilePatternto 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.