Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled rejection TypeError: expecting an array or an iterable object but got [object Null] #826

Closed
grawlinson opened this issue Oct 28, 2015 · 2 comments

Comments

@grawlinson
Copy link

The 3.0.0 upgrade seems to have broken my web scraper. I get the following error message when trying to run this code:

I've deleted the node_modules directory and reinstalled all modules, as well as creating a new project with barebones code. The issue still persists, but disappears after I roll back bluebird to v2.10.2.

Unhandled rejection TypeError: expecting an array or an iterable object but got [object Null]
    at apiRejection (<dir>/node_modules/bluebird/js/release/promise.js:10:27)
    at PromiseArray.init [as _init] (<dir>/node_modules/bluebird/js/release/promise_array.js:62:19)
    at Promise._settlePromise (<dir>/node_modules/bluebird/js/release/promise.js:546:21)
    at Promise._settlePromise0 (<dir>/node_modules/bluebird/js/release/promise.js:594:10)
    at Promise._settlePromises (<dir>/node_modules/bluebird/js/release/promise.js:677:18)
    at Promise._fulfill (<dir>/node_modules/bluebird/js/release/promise.js:618:18)
    at Request._callback (<dir>/node_modules/bluebird/js/release/nodeback.js:42:21)
    at Request.self.callback (<dir>/node_modules/request/request.js:198:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (<dir>/node_modules/request/request.js:1082:10)
    at emitOne (events.js:82:20)
    at Request.emit (events.js:169:7)
    at IncomingMessage.<anonymous> (<dir>/node_modules/request/request.js:1009:12)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)
@spion
Copy link
Collaborator

spion commented Oct 28, 2015

promisify no longer converts multi-argument callbacks to promises for arrays. This will break every single promisify call on request :(

Use the new multiArgs option when promisifying request. Let us know if it fixes the problem

http://bluebirdjs.com/docs/new-in-bluebird-3.html#promisification-api-changes

@grawlinson
Copy link
Author

It looks like I've got some reading & experimenting to do tonight. Thanks for letting me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants