Version
v18.13.0
Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem
webstreams
What steps will reproduce the bug?
const stream = new ReadableStream({
start (controller) {
controller.close()
},
type: 'bytes'
})
structuredClone(stream, { transfer: [stream] })
an alternative that doesn't throw, but then it doesn't return a ReadableStream(???)
structuredClone(stream) // {}
How often does it reproduce? Is there a required condition?
always
What is the expected behavior?
For it to clone without an error.
What do you see instead?
node:internal/structured_clone:23
channel.port1.postMessage(value, options?.transfer);
^
TypeError: Found invalid object in transferList
Additional information
In Deno, this also throws an error, but in both Firefox and Chrome this works. I don't really know what the correct behavior is and node might implement it as it should be.
Version
v18.13.0
Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem
webstreams
What steps will reproduce the bug?
an alternative that doesn't throw, but then it doesn't return a ReadableStream(???)
How often does it reproduce? Is there a required condition?
always
What is the expected behavior?
For it to clone without an error.
What do you see instead?
Additional information
In Deno, this also throws an error, but in both Firefox and Chrome this works. I don't really know what the correct behavior is and node might implement it as it should be.