Cant deploy my Nest.js backend

Nothing happens after npm run start.

Build command: npm install && npm run build
Start command: npm run start

Node version: 20.8.1

It shows the server is running but nothing happens after

It looks like your application is listening incorrectly:

  • Hostname: [::1] (or, the IPv6 version of localhost)
  • Port: 3000 (and 10000 earlier in the logs, which is conflicting)

Render web services must be bound to and, by default, to port 10000. While there is automatic detection in place for the port, it looks like it can fail detection. The docs cover port binding.

Testing this out with a simple NestJS application, I can confirm that it looked like it might have been successful from the logs, but the deployment was not yet live. Deployment would hang for minutes on end when using a different hostname or port. I’m not sure if the deployments would have eventually been reported as failed because I ended up pushing new commits to try different bindings before waiting around long enough.

Here’s what I tried:

Binding Live :x: :x: :x: :white_check_mark:

Once I used, the application went from cloning to live within 2 minutes.

When bootstrapping your app, pass it to the application’s listen call:

await app.listen(10000, '');

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.