[RCTNetworking] Received data was invalid.
See original GitHub issueHi,
since v0.7.0-rc.2, I get the following error:
[error][tid:com.facebook.React.RCTNetworkingQueue][RCTNetworking.m:384] Received data was invalid.
When trying to fetch() something as follows:
fetch('https://ssl.google-analytics.com/collect', {
method: 'post',
body: hit.toQueryString()
});
This code was working in prior versions of RN. The return from google seems to be an empty gif (1x1px).
P.S. this is from react-native-google-analytics.
Issue Analytics
- State:
- Created 8 years ago
- Comments:40 (32 by maintainers)
Top Results From Across the Web
React native iOS error - "RCTNetworking.sendRequest not ...
I'm getting a compilation error RCTNetworking.sendRequest not found in react native iOS after creating and importing a new react component.
Read more >React native iOS error - "RCTNetworking.sendRequest not ...
It looks like this error can be caused by having multiple debugger tabs open in Chrome. As a previous answer said, doing a...
Read more >react-native - UNPKG
react-native/Libraries/Network/RCTNetworking.mm. Version: ... 501, RCTLogWarn(@"Received data was not a string, or was not a recognised encoding.");.
Read more >Network - Expo Documentation
On web, this method uses the third-party ipify service to get the public IP address of ... Active network connection over mobile data...
Read more >Installation | React Native Navigation - Open Source
a. If you're seeing an error message in Xcode such as: 'ReactNativeNavigation/ReactNativeNavigation.h' file not found.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@nicklockwood The reason why this is affecting me is actually out of my control. I’m sending Google Analytics data to Google’s collect URL, and they send back a 1x1 image. Is there anyway we can “dangerously allow” binary content?
@PaulMest if you want to retrieve images via a network request, you’ll have to do this via the
Image.prefetch()
API, or do it with native code. Retrieving image data on the JS side is not supported in RN (it would be a bad idea since you’d have to base64-encode the data to send it to the native side for display, so it’s better just to keep the image on the native side to begin with).