-
-
Notifications
You must be signed in to change notification settings - Fork 5
Prevent storybook from trying to navigate to 0.0.0.0 #1999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdded an async viteFinal hook to Storybook’s Vite config to set server.host to 0.0.0.0. Correspondingly, removed the --host 0.0.0.0 flag from the Storybook npm script, keeping the port unchanged. No other configuration or scripts were modified. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks (3 passed)✅ Passed checks (3 passed)
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ae3bb35 to
26dbca9
Compare
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
C# Unit Tests130 tests 130 ✅ 19s ⏱️ Results for commit f1add45. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (3)
frontend/viewer/package.json (1)
31-31: Optional: add a safety fallback to prevent any unwanted auto-open.If anyone still sees 0.0.0.0 being opened by tooling, consider adding
--no-openhere and letting Vite/Storybook print URLs only.- "storybook": "storybook dev -p 6006", + "storybook": "storybook dev -p 6006 --no-open",frontend/viewer/.storybook/main.ts (2)
19-26: Reduce shadowing and improve types.Rename the param to avoid shadowing the top-level
configand add a Vite type.- async viteFinal(config) { - config.server = { - ...(config.server ?? {}), + async viteFinal(viteConfig: import('vite').InlineConfig) { + viteConfig.server = { + ...(viteConfig.server ?? {}), host: '0.0.0.0', }; - return config; + return viteConfig; },
19-26: Considerhost: trueand explicitly pin what opens.Using Vite’s idiomatic
host: truebinds to all interfaces without hardcoding the IP; optionally setserver.opento'http://localhost:6006'if anyone still sees 0.0.0.0 opened.- host: '0.0.0.0', + host: true, + // Optional: force the browser to open localhost instead of inferring from host binding + // open: 'http://localhost:6006',
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
frontend/viewer/.storybook/main.ts(1 hunks)frontend/viewer/package.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Build UI / publish-ui
- GitHub Check: Build API / publish-api
- GitHub Check: check-and-lint
- GitHub Check: frontend-component-unit-tests
- GitHub Check: frontend
- GitHub Check: Build FW Lite and run tests
- GitHub Check: Analyze (csharp)
🔇 Additional comments (1)
frontend/viewer/package.json (1)
31-31: CLI flag removal LGTM; matches the goal.This avoids Storybook opening 0.0.0.0 directly. Keep as-is.
Currently
pnpm storybookresults in storybook opening0.0.0.0:6006in your browser, which doesn't work.