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

177
Views
Warning: a promise was created in a handler - bluebird

I'm getting below warning error, please guide me to fix it.

Warning: a promise was created in a handler at anonymous> (/opt/testproj/node_modules/pipeworks/pipeworks.js:72:17but was not returned from it, see http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-created-in-a-handler-but-was-not-returned-from-it at new Promise (/opt/testproj/node_modules/bluebird/js/release/promise.js:77:14)

Sample code:

const bluebird = require('bluebird');
const options = {
                  promiseLib: bluebird
                };
const pgpromise = require('pg-promise')(options);
const connectionString = `postgres://${user}:${password}@${host}:${port}/${database}`; 
const db = pgpromise(connectionString);


db.func('student__find_by_id', [id])                                       
.then((data) => {                                                                                                                   
  return res.json(data);
}).catch((err) => {
   log.error(err);                                                                                                              
});
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

As per my earlier comments, the code shown here cannot throw the error you describe. And situations like this one are comprehensively covered within pg-promise tests.

You should use Bluebird's Long Stack Tracing feature to correctly identify the code that results in this error:

var Promise = require('bluebird');

Promise.config({
    longStackTraces: true
});
over 4 years ago · Santiago Trujillo Report
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!