Warning promise gives wrong file/line
See original GitHub issueUsing “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:
- Created 7 years ago
- Reactions:5
- Comments:7 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@petkaantonov I’ve test it. This is what cleanStack(traceLines) returns me.
So i’m not sure it’s a problem from cleanStack but instead going further I found that :
In fact, I can fix it by removing traceLines[i - 1] and replacing it by traceLines[i]
I’ve tried to fix it doing so :
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 :

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 ?