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.

Warning promise gives wrong file/line

See original GitHub issue

Using “bluebird”: “^3.4.1”, on node v6.3.1, I had a warning about promise not returned. That’s okay, but the Warning tell me that :

(node:33144) Warning: a promise was created in a handler at domain.js:293:12 but was not returned from it, see http://goo.gl/rRqMUw
    at new Promise (D:\Projects\giraf-back\node_modules\bluebird\js\release\promise.js:77:14)` 

Which is not a file in my project (I assume it belong to node). If I now go in debuggability line 441 in release (or see here the file:line in the bluebird repo ), by removing the break, I can see the proper location

(node:34872) Warning: a promise was created in a handler at D:\Projects\giraf-back\databases\MongoDB\collection.js:77:12 but was not returned from it, see http://goo.gl/rRqMUw
    at new Promise (D:\Projects\giraf-back\node_modules\bluebird\js\release\promise.js:77:14)

(Edit: In fact, I can’t, the proper location was the second items models\\request.js)

This is what I have by default (eg: not removing the break), if I display the stacktrace (by adding console.log(stack) between L440 and L441).

[ '    at Collection.insert (D:\\Projects\\giraf-back\\databases\\MongoDB\\collection.js:77:12)',
  '    at D:\\Projects\\giraf-back\\models\\request.js:10:30',
  '    at bound (domain.js:280:14)',
  '    at runBound (domain.js:293:12)',
  '    at runCallback (timers.js:570:20)',
  '    at tryOnImmediate (timers.js:550:5)',
  '    at processImmediate [as _immediateCallback] (timers.js:529:5)' ]
(node:36620) Warning: a promise was created in a handler at D:\Projects\giraf-back\databases\MongoDB\collection.js:77:12 but was not returned from it, see http://goo.gl/rRqMUw
    at new Promise (D:\Projects\giraf-back\node_modules\bluebird\js\release\promise.js:77:14)

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:5
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Alex-Wernercommented, Jan 11, 2017

@petkaantonov I’ve test it. This is what cleanStack(traceLines) returns me.

image

So i’m not sure it’s a problem from cleanStack but instead going further I found that : image

In fact, I can fix it by removing traceLines[i - 1] and replacing it by traceLines[i]

image

I’ve tried to fix it doing so : image I added a conditionnal verification of traceLines[i] and keep the original lines (I’m not sure, but I think there is sometimes where this gaves the good answer ?) But it doesn’t work see here : image

1reaction
Alex-Wernercommented, Nov 30, 2016

Shouldn’t it be better that the package just display the full stacktrace ? Or to let us pass an option too short it or expand it at our wish ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - How do you fix npm WARN config global `--global ...
My solution to solve this problem: Go to C:\Program Files\nodejs. Edit 4 files named npm, npm.cmd, npx, npx.cmd. Open files in VS Code....
Read more >
Changelog - Bluebird JS
The "a promise was created in a handler but not returned from it" warning now highlights the file, line and column where the...
Read more >
Imports Microsoft.Office.Interop flagged as warning, not found ...
Jared, I also tried moving the interop ComReference you gave me to the first ... Librarian Severity Code Description Project File Line Suppression...
Read more >
OUR only angel (bad pun, sorry) anyway I promise I won't post ...
313 Likes, 5 Comments. TikTok video from em (@moonyisapharb): "OUR only angel (bad pun, sorry) anyway I promise I won't post anymore concert...
Read more >
PostCSS API
Returns false if iteration was broke. Container#error(). Returns a CssSyntaxError instance containing the original position of the node in the source, showing ......
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