dev_server_port.ts view source
(options: DevServerPortOptions): string | null import {check_dev_server_port} from '@fuzdev/zzz/dev_server_port.js'; Checks that the dev UI calls the dev server that serves it.
The UI sends its HTTP RPC calls and file bytes to
http://localhost:<PUBLIC_ZZZ_SERVER_PORT> when the variable is set, so a
value naming another port sends them to whatever process listens there.
Login and the WebSocket don't use the variable and keep working, which
makes the misroute easy to miss — so the dev server refuses to start.
Unset or blank is fine: the UI then calls the page's own origin.
vite.config.ts runs this when the dev server starts.
options
returns
string | null
the error to fail the dev server with, or null when the value is consistent