api.structuredClone - fails for {Readable,Writable}Stream in Safari
Nobody has claimed this yet.
- Dominant language
- JSON
- Stars
- 5.8k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 186
Description
What type of issue is this?
Browser bug (a bug with a feature that may impact site compatibility)
What information was incorrect, unhelpful, or incomplete?
The Browser Compatibility shows Safari and Safari iOS fully support structuredClone, but the API fails for ReadableStream or WritableStream.
What browsers does this problem apply to, if applicable?
Safari
What did you expect to see?
A clone of the ReadableStream.
Did you test this? If so, how?
Run the following in the console to test:
let rs = new ReadableStream();
structuredClone(rs, {transfer: [rs]})
Chrome et al will log something like this:
▶︎ ReadableStream {locked: false}
Safari will log this:
▶︎ DataCloneError: The object can not be cloned.
Can you link to any release notes, bugs, pull requests, or MDN pages related to this?
No response
Do you have anything more you want to share?
Transferring streams is also broken for postMessage: https://bugs.webkit.org/show_bug.cgi?id=215485
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/Window/structuredClone
MDN metadata
MDN page report details
- Query:
api.structuredClone - Report started: 2024-10-05T13:15:00.407Z
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the api.structuredClone compatibility entry and read the linked WebKit issue alongside the reported Safari and Safari iOS behavior. Compare the entry with the ReadableStream and WritableStream transfer results; the work is done when the compatibility data no longer claims support that these cases do not provide.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100