You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a node application using highland@2.10.1 I have replaced the native promise implemenation with bluebird@3.4 due to performance consideration via:
global.Promise = Bluebird;
While highland seems to be working just as fine as before, I lot of warning with the content:
(node:1428) Warning: a promise was created in a handler at usr/src/marketing-tasks/node_modules/highland/lib/index.js:517:24 but was not returned from it, see http://goo.gl/rRqMUw
function promiseStream(promise) {
if (_.isFunction(promise['finally'])) { // eslint-disable-line dot-notation
// Using finally handles also bluebird promise cancellation
return _(function (push) {
promise.then(function (value) {
return push(null, value); // it complains here
},
function (err) {
return push(err);
})['finally'](function () { // eslint-disable-line dot-notation
return push(null, nil);
});
});
}
I am unsure if this is either an issue with how highland.js creates promises or if bluebird's warning system fires a false positive.
This is me asking: Does bluebird's warning has any merit for highland.js? Or should this be an issue on bluebird's side?
The text was updated successfully, but these errors were encountered:
k0pernikus
changed the title
Warning when promise library is replaced with bluebird
Warning when native promise implementation is replaced with bluebird
Feb 6, 2017
vqvu
added a commit
to vqvu/highland
that referenced
this issue
Feb 7, 2017
We signify uncaught errors by doing this.emit('error'). This throws an
error if there are no bound handlers. Previously, for promise-based
streams, such thrown errors may propagate up to the promise and be
swallowed by whatever promise implementation the user is using.
We can push data asynchonously to fix this problem. While we're at it,
also return null from promise handlers so that bluebird doesn't
complain. See caolan#588.
In a node application using highland@2.10.1 I have replaced the native promise implemenation with bluebird@3.4 due to performance consideration via:
While highland seems to be working just as fine as before, I lot of warning with the content:
The offending code is index.js in line 517:
I am unsure if this is either an issue with how highland.js creates promises or if bluebird's warning system fires a false positive.
This is me asking: Does bluebird's warning has any merit for highland.js? Or should this be an issue on bluebird's side?
The text was updated successfully, but these errors were encountered: