Closed milesj closed 6 years ago
@milesj did you have any update on that warning?
@fernan256 I haven't really dug into it further, but it's still happening.
It's really annoying, hope we have some answer from the maintainers.
I don't get why this is happening tbh
@zkat so you're looking why this is happening?
I did, it just doesn't make sense. All the promises I can see getting created have handlers attacked to them. foo.pipe()
doesn't create a promise (that I know of?!), so I've no clue why Node is warning about this.
/cc @mylesborins Do you have any clue about this?
pinging @benjamingr since this is using bluebird
When you create a promise in a then
you should generally return it because otherwise it is possible it's not being listened to and can cause an unhandled rejection.
If you explicitly want to opt out of it you have two options
return null
I recommend fixing the core issue (that there is a promise no one is listening to) though :)
@zkat fromManifest
creates a promise in https://github.com/zkat/pacote/blob/latest/lib/fetchers/registry/tarball.js#L55 (when it does fetch
) but does not return it which causes the warning.
In all fairness, that code is fine and the warning is probably a bit too eager since a stream whose continuation we can listen to is returned in that case, just return null
from the then
handler calling fromManifest
would fix it.
Thanks! That seems like an easy enough fix.
@milesj @fernan256 do either of you want to PR that?
@zkat where is the handler that calls fromManifest
?
@zkat @fernan256 I took a stab at it: https://github.com/zkat/pacote/pull/148
@zkat Question when you think the fix is gonna be merged and how can we get the change, is gonna be a new release of the library in npm? Thanks.
@fernan256 it'll be done when it's done.
you can thumbs down all you want, I'm still not going to ship it faster than it's gonna ship ;)
Lol you’re the author you can do whatever you want. I just thought your comment was funny. It’s just a warning so it’s not critical.
go answer my question in the PR :P
It’ll be done when it’s done
this problem showed up on me a few hours ago, is it done, or still waiting to be done?
I'm waiting for extra confirmation on the patch in the pr. I don't consider this urgent because it's just a warning only some folks receive, and there's no actual bug: this is just an overly eager automatic warning making unnecessary noise with valid code.
Getting the same warnings indeed:
arning: a promise was created in a handler at /usr/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/tarball.js
Sorry @zkat , I think I really underrated your valuable work regarding pacote! Since most of the people don't have any clue what is behind the scenes of npm. Thanks!
cool. In any case, this is fixed in pacote@8.1.1
, and will be included with the next npm release (which should be next week, I think).
@zkat great job! Thanks for your work!
This following error is consistently showing up when my team and I run
npm install
on one of our projects. It wasn't happening a couple weeks ago.I'm guessing because this line (https://github.com/zkat/pacote/blob/latest/lib/fetchers/registry/tarball.js#L43) is not returning. Seems that was last touched 2 months ago, which sort of aligns with this showing up for us.
Node: 8.9.1 NPM 5.8.0