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

HighWatermark FAQ clarification #43

Closed
pd8 opened this issue Sep 22, 2022 · 3 comments
Closed

HighWatermark FAQ clarification #43

pd8 opened this issue Sep 22, 2022 · 3 comments

Comments

@pd8
Copy link

pd8 commented Sep 22, 2022

Hi hopefully this is an easy / quick answer

In the FAQ here: https://github.com/sindresorhus/ky-universal#clone-hangs-with-a-large-response-in-node---what-should-i-do
It's stated that Ky is used under the hood and has a default highWatermark of 10mb.

However when using ky-universal I run into issues with cloning at 20kb and looking through https://github.com/sindresorhus/ky I (perhaps naively) don't think a highWatermark default is being set.

Perhaps I'm just missing it, but would be great to get clarification on this.

Thanks in advance.

@sindresorhus
Copy link
Owner

It's set in the fetch polyfill, not in Ky:

globalThis.fetch = (url, options) => fetch(url, {highWaterMark: TEN_MEGABYTES, ...options});

@pd8
Copy link
Author

pd8 commented Sep 22, 2022

Thanks for answering, that's strange, it's not working for me at 20kb using ky-universal. I'll try to create a minimum example and show it.

@pd8
Copy link
Author

pd8 commented Sep 22, 2022

Ah apologies, the internal package we were using was using an old ky-universal package (0.2.2), before the highwatermark was introduced, my mistake!

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

2 participants