NodeJS app build is successful (Render) but Application Error in render at the launch. Status is failed, no error logs

Viewed 167
1 Answers

On Render, if your app is configured for a health check and it does not receive a response code between 200 - 399, it will fail... so the deployment will fail as well.

https://render.com/docs/deploys#health-checks

In my Node/Express app on Render, I was able to get a successful deployment by doing this in my server.js file:

app.get('/', (req, res) => {
  res.sendStatus(200)
})

For context, I'm using Render to host a Google reCAPTCHA validator. I don't need to load anything on the homepage, so just sending the status code was enough (https://github.com/markhillard/invisible-recaptcha-validator).

By sending the status code directly to where the health check was running (in my case it's the root directory: /), it was able to receive a 200 "OK" status and then the deployment finally went "Live".

I'm not sure if this will help your particular situation, but maybe it's worth a shot to try this.

Related