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.

`await-promise` error on mongoose project

See original GitHub issue

Hello, I’m trying lynt on a project that uses mongoose, and I got these errors when using await on a DocumentQuery type from mongoose that behaves like a promise

const user = await UserModel.findById(id);

Is there any way to go around this error

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
saadqcommented, Jun 8, 2018
0reactions
saadqcommented, Jun 6, 2018

Fixed by #16. There is already support for a .lyntrc file as noted here, but it is only for the same stuff that the CLI offers like ignore and such. I don’t really want to add support for configuration of rules, because I think that vastly takes away from the point of this project.

The one thing I may consider is adding a disable property to the settings which allows you to turn off any of the rules, but I think having something like enable wouldn’t make sense – the rules that you would want to enable should already exist in lynt, and if they don’t an issue should be raised about it or there is already a good reason why it shouldn’t be in there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error handling in async await - mongoose - Stack Overflow
You will get error in .catch method of async await. Suppose you have a function handleErrors(req, res, err) { return res.json({ success: ...
Read more >
Node JS with Promise & Async await Mongoose ORM #23
Node JS & React Full Stack Training (Node JS and React JS )Full Playlist for node js crash ...
Read more >
Mongoose v6.8.1: Promises
Mongoose queries are not promises. They have a .then() function for co and async/await as a convenience. If you need a fully-fledged promise,...
Read more >
Returned promise from document's save() method not working ...
Now, I'm using the async/await to wait the the save() method, as per the docs the save() method returns a Promise. So:.
Read more >
Handling those unhandled promise rejections with JS async ...
One of your await ed functions fails (i.e. rejects a promise); You get the error. Another possibility is that you know you need...
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