-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
.arrayBuffer()'s declaration has an unnecessary dependency on Blob support #992
Comments
JakeChampion
added a commit
that referenced
this issue
Jul 18, 2023
JakeChampion
added a commit
that referenced
this issue
Jul 18, 2023
JakeChampion
added a commit
that referenced
this issue
Jul 18, 2023
cr313
added a commit
to cr313/fetch-Js-flow
that referenced
this issue
Apr 19, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Certain React Native JavaScript environments natively support ArrayBuffer but not Blob, causing the polyfill's support matrix to have
arraybuffer: true
butblob: false
.Unfortunately with this config, the
.arrayBuffer()
response handler is never hooked up, because that function's definition is gated on anif (support.blob)
check.I'd like to propose decoupling these so that ArrayBuffer responses are optimistically supported by the polyfill as long as the environment supports the proper types without need for a direct Blob dependency.
Repro
In React Native for Windows 0.64, try
fetch("https://example.com/").then(resp => resp.arrayBuffer())
- this will fail with "arrayBuffer is not a function".Testing this same environment with a local patch to decouple the
support.arrayBuffer
andsupport.blob
checks, the fetch succeeds and can be converted into an ArrayBuffer as needed. I can share the patch is desired!The text was updated successfully, but these errors were encountered: