You are using an old version of Bluebird. The behavior of .reduce
was changed in v1
to work this way:
Like
.map
and.filter
,.reduce
now allows returning promises and thenables from the iteration function.
Please update to the most recent version. This will cause the code to run correctly.