-
Notifications
You must be signed in to change notification settings - Fork 1k
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
bug: Capacitor 4.3 Http/Cookies: Unhandled Promise Rejection: DataCloneError: The object can not be cloned. #5945
Comments
This is most likely related to the See: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm |
I'm getting the same error when trying to upload a file (FormData). Example:
I get the same error even if I set content type header like so: |
I am getting the same error when I try to download a pdf with window.fetch(pdfurl); |
I also ran into this error using |
I also ran into this error while connecting to a remote PouchDB() (https://pouchdb.com/). |
I'm having the same issue... Did you figure out a work-around for this? |
I am always having the issue with posting FormData, does anyone have a solution? |
I fixed this by providing the URL as a string, rather than a URL object. |
Of note, a similar issue happens if you provider headers as a Headers object instead of a plain object. Regular fetch accepts this and I believe this should too. @KevinKelchen so it seems #6132 and a Reference: https://developer.mozilla.org/en-US/docs/Web/API/Headers |
This will be probably solved when PR #6206 is merged |
Hit this with 5.3.0.
as part of OIDC token exchange:
https://github.com/VQComms/oidc-client-ts/blob/main/src/TokenClient.ts#L177 which uses https://github.com/VQComms/oidc-client-ts/blob/main/src/JsonService.ts#L129 which passes |
Ok it seems the Capacitor Http plugin can't handle The official docs suggest https://developer.mozilla.org/en-US/docs/Web/API/Request/Request
|
Parsing and objects in formdata through the above solved this problem for me |
can't reproduce on Capacitor 5.7.0, so it was probably fixed when #6206 got merged as a comment pointed out |
This comment was marked as abuse.
This comment was marked as abuse.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Platform(s)
iOS & Android
Current Behavior
When using Capacitor Http/Cookies on a local build, Mapbox will not load its content anymore. However, this works fine when using the website, or using Capacitor and pointing to the server where the App is hosted on. So it is most likely not related to the implementation.
Possibly this is related to cookies.
Image link: https://user-images.githubusercontent.com/89409894/191803876-cd037583-7a31-4566-b31d-c7a373651b25.png
Code
Current Behavior
The error must not be thrown and Mapbox must load.
The text was updated successfully, but these errors were encountered: