From de19bcdb2056123a886afd49d7f8552486a331b1 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 1 Aug 2026 15:30:38 -0400 Subject: [PATCH 1/2] fix(dev): bind Studio, Preview, and demo-site to IPv4 loopback Without an explicit `server.host`, Vite defaulted to IPv6-loopback-only (`::1`) on at least one contributor's Windows setup, while the trusted local runtime's origin allowlist and bootstrap flow are hardcoded to `127.0.0.1` (packages/local-runtime/src/cli.ts, docs/PHASE3_RUNTIME.md). That mismatch produced two symptoms: browsers whose localhost resolution or network path favored IPv4 couldn't reach a dev server the terminal reported as running, and a real runtime session would reject Studio's origin even once connected. Setting `host: '127.0.0.1'` explicitly on all three dev servers matches what the runtime already expects and removes the platform-dependent IPv6-vs-IPv4 guesswork. Verified: before the fix, `http://127.0.0.1:PORT` was refused while `http://[::1]:PORT` succeeded; after, Vite binds and serves on 127.0.0.1 directly. Co-Authored-By: Claude --- apps/preview/vite.config.ts | 2 +- apps/studio/vite.config.ts | 2 +- examples/demo-site/vite.config.ts | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/preview/vite.config.ts b/apps/preview/vite.config.ts index f4d5ea5..43b800c 100644 --- a/apps/preview/vite.config.ts +++ b/apps/preview/vite.config.ts @@ -4,7 +4,7 @@ import { defineConfig } from 'vite'; export default defineConfig({ plugins: [react()], - server: { port: 5174, strictPort: true }, + server: { host: '127.0.0.1', port: 5174, strictPort: true }, test: { environment: 'jsdom', include: ['src/**/*.test.{ts,tsx}'], diff --git a/apps/studio/vite.config.ts b/apps/studio/vite.config.ts index 3fa00c8..43a51c2 100644 --- a/apps/studio/vite.config.ts +++ b/apps/studio/vite.config.ts @@ -4,7 +4,7 @@ import { defineConfig } from 'vite'; export default defineConfig({ plugins: [react()], - server: { port: 5173, strictPort: true }, + server: { host: '127.0.0.1', port: 5173, strictPort: true }, test: { environment: 'jsdom', include: ['src/**/*.test.{ts,tsx}'], diff --git a/examples/demo-site/vite.config.ts b/examples/demo-site/vite.config.ts index a317e62..f8083a3 100644 --- a/examples/demo-site/vite.config.ts +++ b/examples/demo-site/vite.config.ts @@ -1,3 +1,6 @@ import react from '@vitejs/plugin-react'; import { defineConfig } from 'vite'; -export default defineConfig({ plugins: [react()], server: { port: 5175, strictPort: true } }); +export default defineConfig({ + plugins: [react()], + server: { host: '127.0.0.1', port: 5175, strictPort: true } +}); From 721eb240b2aa3d60b018ed08f754ec23679efd27 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 1 Aug 2026 15:59:08 -0400 Subject: [PATCH 2/2] fix(dev): give the marketing site its own port frontend/vite.config.ts had no server config at all, so it defaulted to Vite's standard port 5173 -- the same port Studio uses -- and to IPv6-loopback-only binding. Once frontend joined the workspace dev fleet, `pnpm dev` started both on port 5173 simultaneously: Studio on 127.0.0.1 (this branch's earlier fix) and frontend on ::1. Since a browser's default localhost resolution tries IPv6 first, this made frontend win the race and silently serve at localhost:5173 instead of Studio, with no error from either side. Gives frontend an explicit 127.0.0.1:5176 with strictPort, matching the other three dev servers, so a real collision now fails loudly instead of one server silently masking another. Updates SETUP.md's port table and override examples. Verified: `vite` in frontend/ now reports "Local: http://127.0.0.1:5176/". Co-Authored-By: Claude --- docs/SETUP.md | 9 ++++++++- frontend/vite.config.ts | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/SETUP.md b/docs/SETUP.md index 962c2b9..634d2b6 100644 --- a/docs/SETUP.md +++ b/docs/SETUP.md @@ -56,6 +56,7 @@ pnpm dev | Studio | `http://localhost:5173` | | Preview | `http://localhost:5174` | | Axis 65 demo site | `http://localhost:5175` | +| Marketing site | `http://localhost:5176` | Start only one workspace when needed: @@ -63,6 +64,7 @@ Start only one workspace when needed: pnpm --filter @universal/studio dev pnpm --filter @universal/preview dev pnpm --filter @universal/demo-site dev +pnpm --filter universal-marketing-site dev ``` ## Windows PowerShell @@ -116,10 +118,15 @@ Stop the process already using the port, or deliberately override the port for t pnpm --filter @universal/studio dev -- --port 6173 pnpm --filter @universal/preview dev -- --port 6174 pnpm --filter @universal/demo-site dev -- --port 6175 +pnpm --filter universal-marketing-site dev -- --port 6176 ``` Use the URL printed by Vite after an override. Any integration expecting the default Studio, -Preview, or demo URL must be updated for that run. +Preview, demo, or marketing-site URL must be updated for that run. + +All four dev servers bind `127.0.0.1` explicitly and use `strictPort`, so a collision fails loudly +with `Port is already in use` instead of one server silently serving on the port you expected +another to use. On Windows, inspect a port without terminating anything: diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 56f7628..01090b6 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,4 +1,7 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; -export default defineConfig({ plugins: [react()] }); +export default defineConfig({ + plugins: [react()], + server: { host: '127.0.0.1', port: 5176, strictPort: true } +});