Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

181
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda