Incompatibility with bluebird 1.0.2 (no method '_fulfill') #176
Comments
Okay, I tracked it down in my code:
The above resulted in the error, while adding a .then() or .exec to the knex line fixes it. |
Okay, still having related problems. Here is a script that replicates the error:
|
So it seems to me that the new version of bluebird does not chain with the promises returned by knex. |
Not sure if this helps, but if you restructure your code like this, the error goes away: var Promise = require('bluebird');
var Knex = require('./knex/knex');
var db = Knex.initialize({
client: 'sqlite3',
connection: { filename: './db.sqlite' }
});
function saveResult() {
return db('test')
.insert({ foo: 'bar' });
}
function promiseMe() {
return Promise.resolve();
}
promiseMe().then(function () {
return saveResult();
})
.then(function () {
console.log('inserted');
})
.catch(function (err) {
console.log(err);
}); Can't look into this further at the moment, but I might have time later on. |
@petkaantonov I haven't looked at it yet, but this sounds like a strange error... Any ideas what might have happened here between 1.0.1 and 1.0.2? |
All right, if you grab the latest knex, it requires bluebird 1.0.x which should fix this, until petkaantonov/bluebird#93 is fixed. |
I will get home in a few hours and will investigate this |
Updating bluebird in my app to "latest" (v1.0.2) results in this error:
It works fine in Bluebird 1.0.1.
I will try to reproduce this with a minimal example, but I'm fairly certain it's an incompatibility between knex and bluebird, as two of my knex-powered apps did this.
The text was updated successfully, but these errors were encountered: