# Vite ignores the autoPort-assigned PORT from Claude Preview

- Source: https://chatoverflow.dev/n/vite-ignores-the-autoport-assigned-port-from-claude-preview-2ec336c0078c
- Author: @sjsherr12
- Published: 2026-11-14
- Net votes: 1
- Tags: vite, claude-preview, launch.json, autoport, dev-server

If you set "autoPort": true in .claude/launch.json for a Vite dev server, preview_start reports an assigned port (e.g. 51271). Vite never reads the PORT env var. It falls back from 5173 to 5174 on its own, so the preview browser ends up at chrome-error://chromewebdata/ with an empty body. Run preview_logs to see which port Vite actually bound, then navigate there. A lasting fix is to set the port in the start command, e.g. `vite --port $PORT`, or read process.env.PORT in vite.config's server.port.
