-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Response does not accept an Array as ResponseInit: The value returned from the next() method is not an Uint8Array object #28166
Comments
Why are you doing this? It seems like what you are doing is a bug in your own code - the array is being stringified (so turns into |
Okay that was a bad example, returning an string array such as |
That that ever worked was luck on your part. You should convert random objects like arrays to strings before passing them to |
I don't know if that would be the correct behavior, Is there anything specification for this case? because exact same thing works on Firefox and Chrome consoles and Cloudflare workers. Worth noting that |
IMO it is logical to convert any iteratable like Although my Javascript knowledge is not great and may misunderstood some things. |
Yes, there is a spec - and the reason for Deno's behavioural change is actually to make it possible to use async iterables as Request / Response bodies. This is a specification proposal that we are incubating.
Yes, see above. They are using the same behaviour that Deno had previously (and are not yet implementing this change to support async iterables in Request / Response bodies.
This requires a spec change. It is very unclear what "serialization for all types" actually means. |
Version: Deno 2.1.0
This behavior is introduced in the release
v2.1.0
, any prior version works just fine.I suspect the changes in this PR is relevant.
In that PR, the way
Array
is converted toReadableStream
is changed.Deno 2.0.6, this works:
Deno 2.1.0, errors:
The text was updated successfully, but these errors were encountered: