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.

a promise was created in a handler but was not returned from it

See original GitHub issue

Hello,

I am trying to use Koa with MongooseJS.

here is the MongooseJS code

export function* update(next) {
  this.response.body = yield Item
    .findById(this.params.id).exec()
    .then(item => {
      const updated = _.merge(item, this.request.body);
      return updated.save();
    });
}

Seems like I’m missing something obvious but I don’t know what is it.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
meehowcommented, Nov 29, 2015

This is new bluebird feature (mongoose is using it). http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-created-in-a-handler-but-none-were-returned-from-it It means that something is broken in mongoose. It shows up only when you use then and have BLUEBIRD_DEBUG=1 or NODE_ENV=development in your env.

0reactions
tjcommented, Dec 1, 2015

whoop!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bluebird warning "A promise was created in a handler but was ...
If it determines that a Promise was created at any point while your handler is running (that includes anywhere down in the callstack),...
Read more >
A promise was created in a handler but was not returned from it.
This usually means that you simply forgot a return statement somewhere, which will cause a runaway promise that is not connected to any...
Read more >
a promise was created in a handler but was not returned from it
If I run a simple Promise or any other Sequelize call (find, update, create) without the transaction it does not show this warning....
Read more >
a promise was created in a handler at but was not returned ...
You created a promise here: Promise.all(CACHE.List .filter(shouldLoadFile) .map(file => Tutorials.get(file.id).then(content => { CACHE.
Read more >
warning: a promise was created in a handler but was not returned ...
Bluebird is a fully featured JavaScript promises library with unmatched performance. bluebird npm. This is a playground to test code. It runs a...
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