18 days ago
Project: Truecosmic-Library
Environment: production
Plan: Pro
Description of the issue:
Build consistently fails during npm ci at almost exactly 4m13s–4m37s every time (5+ attempts), with the generic npm crash "Exit handler never called!".
What I've ruled out:
- Memory: build replica has 24GB allocated (max on plan); the same install completes in 49s using ~784MB peak when tested in an isolated environment with matching Node version and NODE_ENV=production
- Double-install conflict: confirmed single clean install step via RAILPACK_INSTALL_CMD (npm ci --include=dev --omit=optional)
- Native compilation: excluded all optional deps (including the one native addon in the dependency tree) with --omit=optional, no change in outcome or timing
- npm-level network retry/timeout settings: added NPM_CONFIG_FETCH_RETRIES=5 and NPM_CONFIG_FETCH_TIMEOUT=300000, failure timing was completely unchanged (still ~4m19s)
The consistent ~4 minute timing across every variation strongly suggests a build-step timeout or container-level network restriction on Railway's side, rather than an issue with my dependencies or lockfile.
Repo: github.com/truecosmic2025/Truecosmic-Library (private)
Could someone check build container logs/network logs for this service around the failure times? Happy to share specific deployment IDs on request.
4 Replies
18 days ago
This thread has been opened as a public bounty so the community can help solve it. The thread and any further activity are now visible to everyone.
Status changed to Open Railway • 18 days ago
18 days ago
The error Exit handler never called! is usually solved by deleting your lockfile and node_modules, run npm install to generate a clean lockfile, and commit the changes to your repo.
darseen
The error `Exit handler never called!` is usually solved by deleting your lockfile and node_modules, run `npm install` to generate a clean lockfile, and commit the changes to your repo.
18 days ago
Thanks for the quick response! I should clarify — I'd already ruled this out before opening the ticket: npm ci (which hard-fails on any lockfile drift) completed successfully in under a minute in an isolated test environment using the same Node version and NODE_ENV=production, with zero errors. The lockfile itself isn't the issue — the exact same install only fails when run inside Railway's build container specifically, consistently at the ~4 minute mark, regardless of lockfile state, install command, or npm settings I've tried. Could this be escalated to someone who can check the actual build container logs for this deployment? Happy to provide specific deployment IDs.
18 days ago
This error can also happen because of a specific node/npm version. You can try to change your node version, or switch to another package manager like pnpm (which will most likely fix your issue).
You can check out this thread for more information: https://github.com/npm/cli/issues/7657
18 days ago
Am experiencing something similar. Deleting lock file and node-modules doesnt help.
npm run build
490ms
npm warn config production Use --omit=dev instead.
rest-express@1.0.0 build
vite build && esbuild server/index.ts --platform=node --packages=external --bundle --format=esm --outdir=dist
sh: 1: vite: not found
Build Failed: build daemon returned an error < failed to solve: process "npm run build" did not complete successfully: exit code: 127 >