-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Cannot set property duplex of #<Request> which has only a getter #7468
Comments
This is probably a result of #7412 where we had to add the |
This behavior of
Note that the |
Then this is on Ky's end, because in the code that was linked they modify that property after initialising the request. |
I'm seeing OP described behavior in SvelteKit and I'm not using Ky. Kit 529 + Node Adapter 100. Occurs on POST requests only. |
@vhscom please provide a minimal reproducible repo. |
For those who see this issue, ensure you're passing const res = await fetch('/api/listing', {
method: 'POST',
// @ts-ignore-next-line - Types outdated
duplex: 'half',
body: JSON.stringify(theBody)
}); If helpful, pin |
Describe the bug
As of SvelteKit 1.0.0-next.406, I started getting this issue in server endpoints that used ky for making web reqeusts:
The issue stems from it setting
request.duplex
like this:In SvelteKit 1.0.0-next.406,
supportsRequestStreams
started evaluating to true. It's defined as this:For context, setting
request.duplex
seems to be needed for compatibility with Chrome 105: sindresorhus/ky@316fffeI'm not sure entirely sure if this is an incorrect implementation in SvelteKit, or if the issue is with ky.
Ky issue: sindresorhus/ky#467
Reproduction
https://github.com/probablykasper/sveltekit-fetch-duplex-bug
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: