fix(templates): add server.host 127.0.0.1 to all v3 vite configs#5361
Conversation
Since alpha.79, Wails forces tcp4 when connecting to the Vite dev server, which breaks on systems where localhost resolves to ::1 (IPv6). Setting server.host to 127.0.0.1 ensures Vite listens on IPv4. Closes #5348 Co-authored-by: multica-agent <github@multica.ai>
There was a problem hiding this comment.
Pull request overview
This PR updates the v3 project templates’ Vite configuration to explicitly bind the dev server to IPv4 loopback (127.0.0.1), preventing wails3 init + wails3 dev projects from failing to load on systems where localhost resolves to IPv6 (::1) while Wails connects via IPv4 (tcp4).
Changes:
- Added
server.host: "127.0.0.1"to all v3 Vite-based templates’vite.config.*files. - Integrated the host setting into existing
serverconfig blocks (e.g., SvelteKit) without otherwise altering template behavior.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| v3/internal/templates/vue/frontend/vite.config.js | Bind Vite dev server to 127.0.0.1 for IPv4 loopback. |
| v3/internal/templates/vue-ts/frontend/vite.config.ts | Same as above for Vue TS template. |
| v3/internal/templates/vanilla/frontend/vite.config.js | Same as above for Vanilla template. |
| v3/internal/templates/vanilla-ts/frontend/vite.config.ts | Same as above for Vanilla TS template. |
| v3/internal/templates/sveltekit/frontend/vite.config.js | Adds host to existing server block (keeps fs allow rules). |
| v3/internal/templates/sveltekit-ts/frontend/vite.config.ts | Same as above for SvelteKit TS template. |
| v3/internal/templates/svelte/frontend/vite.config.js | Bind Vite dev server to 127.0.0.1 for IPv4 loopback. |
| v3/internal/templates/svelte-ts/frontend/vite.config.ts | Same as above for Svelte TS template. |
| v3/internal/templates/solid/frontend/vite.config.js | Bind Vite dev server to 127.0.0.1 for IPv4 loopback. |
| v3/internal/templates/solid-ts/frontend/vite.config.ts | Same as above for Solid TS template. |
| v3/internal/templates/react/frontend/vite.config.js | Bind Vite dev server to 127.0.0.1 for IPv4 loopback. |
| v3/internal/templates/react-ts/frontend/vite.config.ts | Same as above for React TS template. |
| v3/internal/templates/react-swc/frontend/vite.config.js | Bind Vite dev server to 127.0.0.1 for IPv4 loopback. |
| v3/internal/templates/react-swc-ts/frontend/vite.config.ts | Same as above for React SWC TS template. |
| v3/internal/templates/qwik/frontend/vite.config.js | Bind Vite dev server to 127.0.0.1 for IPv4 loopback. |
| v3/internal/templates/qwik-ts/frontend/vite.config.ts | Same as above for Qwik TS template. |
| v3/internal/templates/preact/frontend/vite.config.js | Bind Vite dev server to 127.0.0.1 for IPv4 loopback. |
| v3/internal/templates/preact-ts/frontend/vite.config.ts | Same as above for Preact TS template. |
| v3/internal/templates/lit/frontend/vite.config.js | Bind Vite dev server to 127.0.0.1 for IPv4 loopback. |
| v3/internal/templates/lit-ts/frontend/vite.config.ts | Same as above for Lit TS template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (20)
WalkthroughAll 20 Vite configuration files in the template suite are updated to explicitly set the dev server host to ChangesVite Dev Server Host Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Co-authored-by: multica-agent <github@multica.ai>
…): add server.host 127.0.0.1 to all v3 vite configs
Summary
server.host: "127.0.0.1"to all 20 v3 template vite configs (vanilla, vue, svelte, sveltekit, react, react-swc, solid, qwik, preact, lit — both plain and -ts variants)wails3 initprojects failing to load on systems wherelocalhostresolves to::1(IPv6)Root Cause
PR #5265 (alpha.79) forces
tcp4when Wails connects to the Vite dev server, but Vite's defaultlocalhostcan resolve to::1(IPv6) on macOS and Windows. Explicitly binding Vite to127.0.0.1ensures it listens on IPv4 so the tcp4 connection succeeds.Closes #5348
Summary by CodeRabbit