Railway · infra · fg-0074

Node service on Railway crashes with 'Premature close' or undici errors at boot

If you see Premature close on token or API fetches, the cause and the fix for Railway are below, last verified 2026-07-05.

Staletrust 50/100

This trap has not been confirmed recently and may be out of date.

Symptom
Premature close on token or API fetchesundici crash at startupWorks locally on Node 22
Cause
Without a pinned engine, Nixpacks built with Node 18.
Fix
Pin the Node version in package.json.
Apply
"engines": { "node": "22.x" }
Affected
Railway Nixpacks, July 2026

Last verified 2026-07-05 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun