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.

findAll promise warning

See original GitHub issue

What are you doing?

module.exports = {
  async getSeries(req, res) {
    const limit = req.swagger.params.limit.value || 5;
    const offset = req.swagger.params.offset.value || 0;
    const allSeries = await series
      .findAll({
        limit,
        offset,
      });
    res.json(allSeries);
  },
};

The query works, there are no errors.

What do you expect to happen?

No warnings.

What is actually happening?

Warning:

(node:21938) Warning: a promise was created in a handler at domain.js:126:23 but was not returned from it, see http://goo.gl/rRqMUw
    at Function.Promise.cast (/a/project/node_modules/bluebird/js/release/promise.js:196:13)

Output, either JSON or SQL

Everything works. Just want to get rid of the warning.

Dialect: mysql Dialect version: idk Database version: 8 Sequelize version: 4.42.0 Tested with latest release: No

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
ratulSharkercommented, Oct 25, 2019

Hi @papb Sorry for late response, i was struggling with the warning to come up into the terminal. Setting the NODE_ENV=development was the missing link.

Demonstrating the warning can be found here. I added it as a pull-request. I only configured the NODE_ENV for the travis ci, so for now you can see the warnings here.

I didn’t added the NODE_ENV thats why appvoyer ci, that is why log did not shows the warning.

I’m also getting this warning while running in NODE_ENV=development mode.

Bluebird doc confirms that setting the NODE_ENV=development mode, enables BLUEBIRD_WARNINGS

Both features are automatically enabled if the BLUEBIRD_DEBUG environment variable has been set or if the NODE_ENV environment variable is equal to “development”.

1reaction
chengshubeicommented, Mar 26, 2020

Yes, I also find this warning occured when i set NODE_ENV=development with version 5.21.5 Its bluebirds problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Promise warning after a mysql query - Stack Overflow
Doesn't matter. User.findAll returns a promise, which is not returned. That's where the error comes from. – Ludovic C. Dec 23, 2015 at...
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 >
Say Something - Sandy Hook Promise
Sandy Hook Promise's no-cost Say Something program teaches middle and high school students to recognize the warning signs of someone at-risk of hurting ......
Read more >
triggeruncaughtexception promise - You.com | The AI Search ...
On running the AzureStaticWebApp recently there was node and npm upgradation which caused a promise error i.e triggerUncaughtException as shown below in ...
Read more >
SQL (Sequelize) | NestJS - A progressive Node.js framework
Warning In this article, you'll learn how to create a DatabaseModule based on the ... typeof Cat ) {} async findAll(): Promise<Cat[]> {...
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