#245 changed the declared default port from 3000 → 4443 in src/config.js. That PR landed cleanly in April 2026.
But three runtime fallbacks in src/server.js were missed — they still read options.port || 3000, so any code path that reaches createServer() without options.port set (no --port flag and no config loaded) lands on 3000, not 4443:
src/server.js:867: const port = options.port || 3000;
src/server.js:1209: const port = options.port || 3000;
src/server.js:1220:export async function startServer(port = 3000, host = '0.0.0.0') {
This creates a real inconsistency: a user who reads src/config.js or docs/configuration.md sees 4443, but in some startup paths (programmatic embedders, tests that call startServer() with no port, certain CLI flag combinations) they get 3000.
Fix
Three one-line changes:
// src/server.js:867 + 1209
const port = options.port || 4443;
// src/server.js:1220
export async function startServer(port = 4443, host = '0.0.0.0') {
Or, more rigorously, import the canonical default from src/config.js:
import { defaults } from './config.js';
// ...
const port = options.port || defaults.port;
The second form is the better long-term shape — one source of truth, future port changes only touch config.js.
Test plan
- Grep
grep -nE "port.*3000|3000.*port" src/ returns nothing (no leftover 3000 fallbacks in the port resolution path)
bin/jss.js start with no --port lands on 4443
- Any existing test that called
startServer() with no port arg still passes (or is updated to pin the expected port explicitly)
Cross-references
- #245 — the change that this follow-up completes
- #250 — earlier port-related bug that motivated the canonicalization
#245 changed the declared default port from 3000 → 4443 in
src/config.js. That PR landed cleanly in April 2026.But three runtime fallbacks in
src/server.jswere missed — they still readoptions.port || 3000, so any code path that reachescreateServer()withoutoptions.portset (no--portflag and no config loaded) lands on3000, not4443:This creates a real inconsistency: a user who reads
src/config.jsordocs/configuration.mdsees4443, but in some startup paths (programmatic embedders, tests that callstartServer()with no port, certain CLI flag combinations) they get3000.Fix
Three one-line changes:
Or, more rigorously, import the canonical default from
src/config.js:The second form is the better long-term shape — one source of truth, future port changes only touch
config.js.Test plan
grep -nE "port.*3000|3000.*port" src/returns nothing (no leftover3000fallbacks in the port resolution path)bin/jss.js startwith no--portlands on 4443startServer()with no port arg still passes (or is updated to pin the expected port explicitly)Cross-references