Nima Soufiloo
Nima Soufiloo

Reputation: 254

Bluebird .finally is not a function node.js error

I'm new to Promises and I'm not sure why I'm getting this error using bluebird:

.finally is not a function

my code structure looks like this:

const Promise = require('bluebird');

worker();

function worker(){
  Promise.try(
    do something ...
      .then(
        do something ...
          .then(
            do something ...
              .then(
                do something ...
                  )
                    .catch(log.error)
                )
                  .catch(log.error)
           )
        .catch(log.error)
        .finally(() => {
            worker().delay(5000);
        })
    )
}

I appreciate any help on this matter.

Upvotes: 2

Views: 2959

Answers (1)

Nima Soufiloo
Nima Soufiloo

Reputation: 254

I guess ".finally" wasn't supported in node version 8. updated node to version 10 and its now working.

Upvotes: 5

Related Questions