Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Dennis Ploeger
    I'm iterating over an array, but the promise is never resolved or rejected.
    Dennis Ploeger
    Argh, sorry. Just found the error.
    I was returning a promise in a (reject, resolve) -Function. :)
    Patrick Malouin
    Hi, I seem to be getting a big performance regression when upgrading node from 6.11.3 to 8.5.0. The bottleneck seems to be around long stack traces, so not really critical in production. Did anyone else witness this problem? I'm using bluebird@3.5.0.
    'use strict';
    const bluebird = require('bluebird');
    const repeat = 100000;
    const array = [];
    for (let i = 0; i < repeat; i++) {
    bluebird.mapSeries(array, () => {
            return bluebird.resolve();
        .then(() => {
    Goes from ~1.6s to 31s (with NODE_ENV=development).
    Patrick Malouin
    ok, just found related issue: petkaantonov/bluebird#1337
    Shlomi Levi
    Hi, If I use async await in nodejs. do I need bluebird?
    Aliaksandr Yankouski
    @wizardnet972 it is the same question as "I use array iteration. do I need toforEach". It is just library to facilitate your work with promises, taking performance into account. So it's your decision.
    Gašper Gračner

    Hi everyone,
    In my application i am using bluebird and rxjs. I am trying to return bluebird promise as observable but i get a warning

    (node:34520) Warning: a promise was created in a handler at Users/gaspergracner/Projects/node_modules/rxjs/observable/PromiseObservable.js:66:36 but was not returned from it, see http://goo.gl/rRqMUw
    at Function.Promise.attempt.Promise.try (/Users/gaspergracner/Projects/node_modules/bluebird/js/release/method.js:29:9)

    this is what causes a problem:

    public getUserByUsername(username: string): Observable<any>  {
        let $obs = Observable.fromPromise(User.findOne({
          where: {
            username: username
        return $obs;

    Maybe you know how to avoid this warning?

    Dennis Ploeger
    I have some sort of "style" question: Is it an anti-pattern to explicitely use "return Bluebird.resolve(<value>);" instead of just using "return <value>;"?
    I find it a bit more clearer to use that pattern, although the second one obviously works, too.
    Using the second one will give you problems when you're using Bluebird in Typescript, because the return type doesn't match.
    Paul Tiseo
    Given a .then(params => {});, I want to add a property to params, where the value is a promise that processes another property of params as argument. I'm having a hard time wrapping my head around this. For example, assume params is passed in as { prop1: [{},{},{}] } initially. I want to return a promise that eventually resolves to { prop1: [{},{},{}], prop2: ["","",""] }, where prop2 was evaluated from a promise that depended on prop1. How could I do this?
    i am getting a problem with an event emitter giving me this error Unhandled rejection TimeoutError: operation timed out at afterTimeout (/home/ubuntu/workspace/node_modules/bluebird/js/release/timers.js:46:19) at Timeout.timeoutTimeout [as _onTimeout] (/home/ubuntu/workspace/node_modules/bluebird/js/release/timers.js:76:13) at ontimeout (timers.js:386:14) at tryOnTimeout (timers.js:250:5) at Timer.listOnTimeout (timers.js:214:5)
    Bnaya Peretz
    issue(?) with map() index parameter gives me a series like that:
    Starts with zero, and then counting down from the end
    David Luzar
    @Bnaya can you paste the code?
    i have strange work of Promise.all. I want to insert in base 10k notes, but fetch only 10. node 7.10.1 bluebird 3.5.1
    let fetchbase = [];
    for (var i = 0; i < res.length; ++i) {
         fetchbase.push(insertDB('INSERT INTO city SET ?', res[i]));
    return Promise.all(fetchbase);
    let insertDB = (sql,arr) => {
        return new Promise(function(resolve, reject) {
                connection.query(sql,arr,function(err,result) {
                    if (err) {
                        throw err;
    Can someone tell me what the heck is going wrong?
    I'm doing a query to mongodb (toArray()), as values of an object.
    But when I do Promise.props, I end up with something like Promise{ [values...]} and it fails Array.isArray. What happened....?? Totally confused here.
    item: Promise { [] }
    well, adding .then(fp.mapValues(fp.toArray)) works...
    does the bluebird sing ?
    Steve Cox
    Hi All.. I am having an issue with Promise.filter, could someone advise?
    Hi. I'm using bluebird with aurelia and only in firefox we get an illegal character error in bluebird.min.js v3.5.1 when it loads. IE and Chrome are fine. Has anyone experienced this with firefox?
    @fratting Appears to be a variety of problems, one of which is the tryCatcher function executing a function called 'bound error'. the target var is the source of the illegal character. Another instance is the console.warn at like 1546 of the unminified bluebird.js file. console is considered an illegal character. Odd and only with firefox
    Martijn Poelman
    Can someone point me in the right direction using bluebird promises in Aurelia? I have tried tons of methods but I keep getting the same type of errors (bluebird has no export default 'Promise', compiler error: duplicate key 'Promise' and such)
    Also, "Promise.config is not a function", and "Promise is not a constructor"
    Ziad El Khoury Hanna
    What is the license for the code snippets in the Bluebird's Wiki, more specifically the Optimization killers?
    Thank you
    Owen Garland
    Where is best to ask for some clarification on a bluebird functions flow?

    Basically was hoping Promise.map().then() would run after all the mapped promises, however the then is running immediately.


    So I would hope for the indexes to be built after the save operations, but it's happening immediately.
    Ziad El Khoury Hanna
    @bag-man you are using it correctly, but the mapper function should return a promise; It currently returns nothing (or undefined) which means that all the promises are resolved with undefined and so the then is running immediately
    Owen Garland
    Ahhhh I see, let me try that :)
    Beautiful, that was it, thank you so much! The pain that has saved me :D
    Ziad El Khoury Hanna
    @bag-man Great :smile:
    Owen Garland
    I'd been banging my head on this script for a week, and just sorted it in like two hours. Shows what a good nights sleep can do! Right I shall be off, thanks again!
    David Schwartz
    Hey everyone, I am trying to make an objects of objects from promise values. What I'd like to do is have an object with multiple objects, and from there have multiple objects pointed at other objects that are pointed at promise.props. Does anyone know of a way to do this?
    Krishnan Subramanian
    Hi #channel .. are bluebird promises safe to use with async/await .. i.e. can I use await on a bluebird promise ?
    Roberto Di Lillo
    Hi guys, is anyone able to address me to the proper resourses to promisify my mysql in node?
    Eric Eastwood
    Roberto Di Lillo
    @MadLittleMods sorry for the late late late reply, after trying on and on I actually made it and forgot to write here :)
    thanks guys :)
    Eric Eastwood
    @koop4 What was your solution? Best to post it so future onlookers can reference it
    Hi. there is a statistical analysis tool for performance testing https://github.com/pod4g/hiper/
    Roberto Di Lillo
    Hi guys, I'm trying to understand cooroutine but there must be something i'm not understanding xD
    here's my "not" working example:
    resultSet.map( item => {
          Promise.coroutine( function* (user) {
            let opt = { 
              TableName: 'tableName',
              KeyConditions: {  
                username: {
                  AttributeValueList: [user],
                  ComparisonOperator: 'EQ'
              ProjectionExpression: 'firstname, lastname',
            let userFriends = yield dynamodb.queryAsync(opt)
            /*  random code here to assign first name and last name to item */ 
        return item 
    Hey, I just realized today that in bluebird 3.5.2 Promise.race is disabled. How can I access this function, or is there a different way of using it?
    Eric Eastwood
    @danyextreame_twitter Are you sure? I don't see any notice in the docs and seems to work fine with a quick test in https://npm.runkit.com/bluebird
    Phuong Nguyen
    Anyone has experience setting jwplayer with AWS RMTP?
    I have an issue in bluebird. The issue is that bluebird.config is not a function