Skip to content
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

afterResponse hook causes response Promise to hang #135

Closed
exogen opened this issue May 15, 2019 · 2 comments
Closed

afterResponse hook causes response Promise to hang #135

exogen opened this issue May 15, 2019 · 2 comments

Comments

@exogen
Copy link

exogen commented May 15, 2019

Here's a simple repro: https://github.com/exogen/ky-afterResponse-repro

This doesn't seem to happen for every request; I suspect it might have something to do with the response body size. I tried a couple small public JSON API demos before I landed on a GraphQL endpoint that reproduced the behavior.

Under certain conditions, simply including an afterResponse hook causes the response Promise to hang. The hook doesn't have to do anything; it can be a no-op function or just return the same cloned response. Removing the hook causes it to start working. Switching to node-fetch also works fine.

I wonder if the hook causes the response to be cloned and therefore the Promise as well, making one of them never resolve? Just a thought.

@sindresorhus
Copy link
Owner

Duplicate of sindresorhus/ky-universal#8

@sindresorhus sindresorhus marked this as a duplicate of sindresorhus/ky-universal#8 Aug 23, 2019
@sindresorhus
Copy link
Owner

Can you post your issue description above as a comment on sindresorhus/ky-universal#8?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants