Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

446
Views
HOW DO I FIX ERROR IN DEPLOY HEROKU: UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:80

I can't find the problem when deploying to Heroku. I have already reviewed the code but to no avail.

Apparently, it is something related to some request that is not error handling:

I suspect 2 snippets of the code, because when removing the file they are, the deploy happens normally.

The snippets are:

Reading a .p12 certificate

let cert = fs
    .readFileSync(path
      .resolve(__dirname, `../certs/${ process.env.GN_CERT }`));

Or generating a buffer with the credentials:

 const credentials = Buffer.from(
    `${ clientID }:${ clientSecret }`
  ).toString('base64');

Note: clientID and clientSecret are strings.

ERROR:

2022-04-23T22:13:30.578225+00:00 app[web.1]: (node:22) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:80
2022-04-23T22:13:30.578225+00:00 app[web.1]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1145:16)
2022-04-23T22:13:30.578225+00:00 app[web.1]: (Use `node --trace-warnings ...` to show where the warning was created)
2022-04-23T22:13:30.578305+00:00 app[web.1]: (node:22) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error either by throwing inside of a sync function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
2022-04-23T22:13:30.578341+00:00 app[web.1]: (node:22) [DEP0018] DeprecationWarning: Unhandled promises rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I would appreciate it if you can help.

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!