At Promise fromNode fromCallback - a promise was created but was not returned from it
See original GitHub issue(This issue tracker is only for bug reports or feature requests, if this is neither, please choose appropriate channel from http://bluebirdjs.com/docs/support.html)
Please answer the questions the best you can:
- What version of bluebird is the issue happening on?
- 3.7.2
- What platform and version? (For example Node.js 0.12 or Google Chrome 32)
- Node 12, Heroku worker
- Using babel 7
- Did this issue happen with earlier version of bluebird? Locally there is no issue at all. I haven’t known about this until I pushed to Heroku.
I am having this issue on Heroku:
2020-02-19T12:37:49.314100+00:00 app[worker.1]: (node:4) Warning: a promise was created in a handler at internal/process/task_queues.js:79:21 but was not returned from it, see http://goo.gl/rRqMUw
2020-02-19T12:37:49.314102+00:00 app[worker.1]: at Function.Promise.fromNode.Promise.fromCallback (/app/node_modules/bluebird/js/release/promise.js:206:9)
Since it is pointing to the bluebird node_module directly I assume there might be an issue in the package. (Btw. in the lib at the pointed fromNode.fromCallback there is this weird indentation of a ternary).
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Understanding Promise.fromCallback - Stack Overflow
TL;DR. Promise.fromCallBack returns a promise. This is used if you want to wrap a function in a promise on the fly.
Read more >Promise.fromCallback - Bluebird JS
Returns a promise that is resolved by a node style callback function. This is the most fitting way to do on the fly...
Read more >Bluebird v2.9.27 API Reference
Create a new promise. The passed in function will receive functions resolve and reject as its arguments which can be called to seal...
Read more >Converting callbacks to promises | Zell Liew
It's easier to work with Promises and Async/await compared to callbacks. I teach you how to convert any callback into a promise.
Read more >a promise was created in a handler at but was not returned ...
Coding example for the question Warning: a promise was created in a handler at but was not returned from it [bluebird]-node.js.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh… I bet I know why. I bet the person who raised the issue was creating a Bluebird promise inside the
connect
handler, which would be run synchronously from inside this block. Sneaky.I suppose if you really wanted to create a
Promise<void>
, you couldreturn Promise.resolve()
(orreturn Promise.resolve(undefined)
).