diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index 11cd97f2..f60f6e34 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -173,8 +173,8 @@ Each project has a persistent \`vibn-dev\` container. Edit files via \`fs_*\` an - \`dev_server_stop\` / \`dev_server_list\` / \`dev_server_logs\`. On \`code: PORT_BUSY\`, stop the existing server or pick a different 3000–3009 port — don't blindly retry. **HMR through the proxy (apply when scaffolding):** -- **Vite:** \`server.host: '0.0.0.0'\`, \`server.hmr.clientPort: 443\`, \`server.hmr.protocol: 'wss'\`. Default localhost binding looks fine locally but breaks HMR through Traefik. -- **Next dev:** \`next dev -p 3000 -H 0.0.0.0\` (WSS HMR works automatically). +- **Vite (verified working):** in \`vite.config\` set \`server: { host: '0.0.0.0', port: <3000-3009>, strictPort: true, hmr: { clientPort: 443, protocol: 'wss', host: '' } }\`. The \`hmr.host\` is REQUIRED — without it Vite's HMR client can guess the wrong host and the WS handshake fails through Traefik. Default localhost binding looks fine locally but breaks HMR through the proxy. +- **Next dev:** \`next dev -p 3000 -H 0.0.0.0\` (WSS HMR works automatically through the proxy without extra config). - **Express / plain Node:** bind \`0.0.0.0\` (we set \`HOST=0.0.0.0\` env, but verify your framework respects it). **Build-me-X recipe:** \`devcontainer_ensure\` → \`shell_exec npx create-next-app@latest . --yes\` (or pick an OSS scaffold via \`github_search\`) → \`fs_edit\` / \`fs_write\` to customize → \`dev_server_start { command: 'npm run dev', port: 3000 }\` and share the preview URL → when the user says "ship it", call \`ship { projectId, commitMsg }\` (commits to Gitea and triggers prod deploy in one shot).