question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:

  1. What version of bluebird is the issue happening on?
  • 3.7.2
  1. What platform and version? (For example Node.js 0.12 or Google Chrome 32)
  • Node 12, Heroku worker
  • Using babel 7
  1. 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).

image

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jwaltoncommented, Aug 26, 2021

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.

0reactions
berguscommented, Aug 26, 2021

I suppose if you really wanted to create a Promise<void>, you could return Promise.resolve() (or return Promise.resolve(undefined)).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found