Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DataCloneError: The object cannot be cloned in Safari v17 (using fetch-based MSW) #1757

Closed
4 tasks done
Tracked by #1436
thepassle opened this issue Oct 3, 2023 · 3 comments
Closed
4 tasks done
Tracked by #1436
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:browser Related to MSW running in a browser

Comments

@thepassle
Copy link
Contributor

Prerequisites

Environment check

  • I'm using the latest msw version
  • I'm using Node.js version 14 or higher

Browsers

Safari

Reproduction repository

https://github.com/thepassle/msw-safari-repro

Reproduction steps

  • npm i
  • npm start
  • open browser in safari 17

Current behavior

repro

Expected behavior

No error and the object is cloned successfully

@thepassle thepassle added bug Something isn't working scope:browser Related to MSW running in a browser needs:triage Issues that have not been investigated yet. labels Oct 3, 2023
@thepassle
Copy link
Contributor Author

thepassle commented Oct 3, 2023

Managed to hunt it down to this code:

Screenshot 2023-10-03 at 11 20 26

It seems like its not possible anymore in Safari 17 to postmessage a ReadableStream. both transfer and data.body are ReadableStreams. When I set those values to something else it does work. So it looks like postMessage in combination with ReadableStream is broken.

Im not really sure this is a MSW bug, it kind of seems like a safari bug?

@thepassle
Copy link
Contributor Author

Created an issue on webkit: https://bugs.webkit.org/show_bug.cgi?id=262531

@kettanaito
Copy link
Member

Thanks for looking into it, @thepassle! I will close this until it's proved to be specific to MSW. So far, it looks like a Safari issue.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 2, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:browser Related to MSW running in a browser
Projects
None yet
Development

No branches or pull requests

2 participants