fix: Storybook failing to load/update docs#448
Conversation
- Storybook could not find mockServiceWorker.js; add staticDirs to serve client/public/ where the worker script lives - Add postinstall script to auto-generate mockServiceWorker.js on npm install so it doesn't need to be checked into git - Update DEVELOPMENT.md Storybook section with prerequisites and remove hardcoded port 6006 reference
PR Review: fix: Storybook failing to load/update docsOverall this is a clean, well-scoped fix that correctly addresses the root cause of the MSW service worker not being found by Storybook. The approach is sound and consistent with how MSW + Storybook integrations are typically set up. What looks good
Minor suggestions1. Prefer local binary over "postinstall": "npx msw init public/ --save"Using "postinstall": "node node_modules/.bin/msw init public/ --save"Or via "postinstall": "npx --no-install msw init public/ --save"This is a minor safety/clarity improvement rather than a blocking concern. 2.
"msw": {
"workerDirectory": ["public"]
}The 3. Docs: consider retaining the default port The original docs had:
The replacement:
Storybook does open the browser automatically, but developers often want to know the port to return to it manually (e.g. after accidentally closing the tab, or in environments where auto-open is suppressed). Consider keeping a note like: "Storybook opens automatically at http://localhost:6006" — combining both pieces of information. SummaryThe fix is correct and the changes are minimal and focused. The |
📊 Test Coverage ReportBackend Coverage
Frontend Coverage
Coverage Requirements
Coverage report generated for commit 7014f8e |
- VideosPage story crashed on render due to missing Router context (component uses Link from react-router-dom) - ChannelManager story crashed on render due to missing Router context (component uses useNavigate); MemoryRouter was imported but unused
PR Review: fix: Storybook failing to load/update docsThis is a focused, well-reasoned fix. The three root causes are each addressed correctly. Correctness
"postinstall": "npx --no-install msw init public/ --save"
Minor observations
SummaryThe fix is correct and the scope is appropriately minimal. The |
Uh oh!
There was an error while loading. Please reload this page.