[Bug]: react-storybook-addon-export-to-sandbox never finds its own registration on Windows
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- build-system, tooling
Research direction
Start in packages/react-components/react-storybook-addon-export-to-sandbox/src/webpack.ts and inspect addonFilePattern and how the registered preset name is matched. Run a Storybook target that registers the addon on Windows; done means the registration is found, options are preserved, and the downstream undefined importMappings crash no longer occurs.
Written by the indexing model from the issue text.
Description
Area
storybook
Environment
OS: Windows 11
node v22.12.0
@fluentui/react-storybook-addon-export-to-sandbox 0.3.1
Current Behavior
packages/react-components/react-storybook-addon-export-to-sandbox/src/webpack.ts locates its own
registration by matching the registered preset name against:
const addonFilePattern = /react-storybook-addon-export-to-sandbox\/[a-z/]+.[jt]s$/;
The pattern 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 then silently dropped, and the full-source babel
plugin crashes downstream on an undefined importMappings.
The failure is platform-specific and silent right up to the crash: on Linux CI nothing has ever been
wrong, which is why it has survived.
Expected Behavior
The addon finds its registration and receives its options on every platform the repo supports for
local development.
Reproduction
Run any Storybook in this repo that registers the addon, on Windows. The branch demonstrating both
the failure and the fix is available on request.
Steps to reproduce
- On Windows,
yarn starta Storybook target that registers
@fluentui/react-storybook-addon-export-to-sandbox. - Observe the full-source babel plugin throwing on undefined
importMappings. - Instrument
addonFilePattern— it matches nothing, because the preset name is backslash-separated.
Discovery context
Found while standing up a new Storybook target on a Windows checkout during work on a styling layer
over @fluentui/react-headless-components-preview. Nothing about the finding is specific to that
work — any contributor developing on Windows hits it the first time they run a Storybook that
registers this addon.
Proposed fix
Accept either separator:
const addonFilePattern = /react-storybook-addon-export-to-sandbox[\\/][a-z\\/]+.[jt]s$/;
One line, with a comment explaining why both separators are there so it is not "tidied" back.
A working implementation is included in PR #[WINDMOD-PR-NUMBER] (part of commit 510b8c5d21);
happy to split it into a standalone PR against this issue — it is genuinely independent of
everything else in that PR.
Suggested severity
Medium - Has workaround (develop on Linux/WSL, or disable the addon).
Products/sites affected
Local Storybook development on Windows.
Are you willing to submit a PR to fix?
yes
- Dominant language
- TypeScript
- Stars
- 20.3k
- Forks
- 2.9k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 43
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/fluentui
-
Component: CalendarDayGrid Component: WeeklyDayPicker Fluent UI react (v8) Type: Bug :bug:
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Fluent UI WC (v3) Type: Bug :bug: web-components
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
All issues in microsoft/fluentui
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100