-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
XHR fails with "Invalid response for blob" always when response status 204( no-content ) #18190
Comments
I encountered the same issue when I tried to upgrade from 0.53.0 to 0.54.0, so for now I'm just going to stay on 53 until this is resolved |
Get the same issue |
+1 |
I'm also seeing the same error on 0.54. Works fine in 0.53.3. |
0.53
0.54 XMLHttpRequest blob case
0.54 enforces the response to be an object.. Edit: |
Same here, but only on Android. Iphone seems to work, which makes no sense. |
Any updates or work arounds for this? |
+1, Same problem doing a fetch with method HEAD |
Got the same error on iOS simulator. In my case I'm sending a POST and once it returns 401 (Unauthorized) I get the error of |
Does anyone have a repro case that I can test? |
easy to replicate:
|
I couldn't repro this with a simple server. It would be great if someone has a repro which I can use to fix the issue. |
reproducible in fresh app https://github.com/skv-headless/TestFetch based on @johnckendall answer |
We've got the same issue on our end.
Obviously not ideal... |
This issue seems iOS only? Please always mention the platform when opening an issue. This is a duplicate of #18223 and should be fixed in master. We'll cherry pick it to release version soon. |
same issue here |
@satya164 No I'm getting it on Android only for my part |
Same issue here but in android |
It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55? |
Same issue on android, e.x. POST 'https://apis-test.somedomain.com' |
Duplicate of #18440 |
18440 is Android, this is IOs. 18440 is not about 204 or empty responde either. I don't think they are duplicates @satya164 even if they might have the same root cause. |
@obsidianart this was already fixed on iOS. most comments here reference Android. |
Same issue here with Expo 29 (React Native 0.55.4). The app is running normally in the development and if I preview a build in the Expo app but if I open an |
You are wrong. This IS NOT fixed on iOS! I'm on iOS, see my env below and I get same error. Env:
|
In my case the error is thrown when I imitate offline regime in my app - I switch off WiFi. These are [
1240,
"The Internet connection appears to be offline.",
false
] This is code piece with // app/node_modules/react-native/Libraries/Network/XMLHttpRequest.js:505
this._subscriptions.push(RCTNetworking.addListener(
'didCompleteNetworkResponse',
(args) => this.__didCompleteResponse(...args) // <== here
)); |
Same here for android iOS working fine,,, is there any solution or I have to upgrade react-native ?!?! |
When I try fetch some backend's api, then response, in case of success, has contentType application/json and http status 204 (no content), my api call fails with error: "Invalid response for blob:"
If response have some content, fetch works perfectly;
Update:
RN default fetch( whatwg-fetch ) request fails always when response status 204( no content ), regardless of content-type, request method( tested on GET / POST ).. and, even if response has some data in body, but have status 204 - fetch fails with error "Invalid response for blob:".
Environment
Environment:
OS: macOS Sierra 10.12.6
Node: 9.3.0
Yarn: 1.3.2
npm: 5.6.0
Watchman: Not Found
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: ^16.0.0 => 16.2.0
react-native: ^0.54.0 => 0.54.0
whatwg-fetch: ^1.0.0 => 1.1.1
Expected Behavior
Works normally. Without some errors in fetch only because response has status 204( no content );
Actual Behavior
Fails with error: "Invalid response for blob:"
Steps to Reproduce
Fetch( with default RN fetch ) some backend's API, that response with contentType application/json and http status 204 (no content), i.e response contains only header.
Enjoy fails with.. description about.. blob !?
The text was updated successfully, but these errors were encountered: