-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnhandledPromiseRejectionWarning: TypeError: reader._closedPromise_resolve is not a function #66
Comments
That's odd... that shouldn't happen. Thanks for reporting. Do you have a way to reproduce this problem? A code snippet that I can run, or a repository that I can clone? |
Thanks for the quick response. It's happening in my tests in make-fetch
|
I managed to reproduce it locally right away. Thanks for the very clear reproduction case! 😄 When the readable stream closes (through The polyfill assumes that we'll only ever try to resolve or reject the closed promise once. However, the specification doesn't seem to guarantee that, and your example shows that. So this assumption is incorrect, and the polyfill needs to handle this case. I'll work on a fix as soon as possible. 😉 On a slightly unrelated note: I also noticed that, although the closed promise was still pending, |
Jeeze, sounds pretty complex. Hopefully this'll help others in the future. Is there anything I should do on my end of the code in the meantime? I'm fine with leaving my try-catch hack in there for now. Thank you for investigating! |
It's quite complex, yes. I'm actually amazed something as complicated as this can be triggered with very little code. 😅 Your try-catch hack should be fine for now. Hopefully you'll be able to remove it after the next patch release. 😄 |
Hi, I'm getting an unhandled error even though it seems to be working otherwise.
This is happening with version 3.0.0 installed from NPM on Node v12.16.2
The text was updated successfully, but these errors were encountered: