You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2f2220a
Browse filesBrowse the repository at this point in the historyBrowse files
Read an empty PORT as unset, so SERVER_PORT still moves the server and NaN never reaches Bun.serve (#340)
#312 read the port as `process.env.PORT ?? process.env.SERVER_PORT ?? "3001"`. `??` fires only on
undefined, and a variable a compose file declares but the host never set, or `PORT=` left in a
`.env`, arrives as an empty string: SERVER_PORT was never consulted, the disagreement check
(`PORT && SERVER_PORT && …`) never fired, and `Number.parseInt("")` handed `Bun.serve` a NaN, which
it answers by binding an ephemeral port. The server came up somewhere nobody had asked for, and
the script polling SERVER_PORT reported one that never started — the failure #312 set out to
remove, back through the other name. `parseInt` also parses a prefix, so `PORT=30o1` started the
server on port 30 without a word.
The port is now read by `loadConfig` through the same `optional` every other setting uses, where
empty means unset, refusing anything that is not a whole number in 1–65535 the way the handoff
caps and AGENT_STALL_TIMEOUT_MS already refuse a typo. Tests cover the empty-string case that is
the whole point, the disagreement, and the refusals under both names.
Co-authored-by: kevin9327 <kevin9327@users.noreply.github.com>
0 commit comments