fetch icon indicating copy to clipboard operation
fetch copied to clipboard

Invalid responseType: blob

Open BuddhaBing opened this issue 2 years ago • 3 comments

After installing this library and using react-native-polyfill-globals to polyfill, I'm unable to successfully fetch any data because every request results in Invalid responseType: blob. I encountered this both on an existing project (which uses react-native v0.72.7) and on a completely new/clean app that I spun up to test (again using react-native v0.72.7).

If I add the following to the root index.js file, it works but I'm not sure why this fixes it (this is some code recommended to get network logs working in the now deprecated React Native Debugger) or what the implications would be:

global.XMLHttpRequest = global.originalXMLHttpRequest || global.XMLHttpRequest;

BuddhaBing avatar Dec 14 '23 09:12 BuddhaBing

For context - this is the warning being hit: https://github.com/facebook/react-native/blob/a13d51ff1c38ea85e59f4215563c0dd05452f670/packages/react-native/Libraries/Network/RCTNetworking.mm#L560

kraenhansen avatar Jan 23 '24 13:01 kraenhansen

This is happening for me too. The code you provided fixes the issue but feels dirty. I'm using the polyfill as well as Supabase and the comments Supabase provides in their suggests a problem with CORS.

aciaschetti avatar May 16 '24 07:05 aciaschetti