question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[RCTNetworking] Received data was invalid.

See original GitHub issue

Hi,

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:closed
  • Created 8 years ago
  • Comments:40 (32 by maintainers)

github_iconTop GitHub Comments

1reaction
lwansbroughcommented, May 27, 2016

@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?

1reaction
nicklockwoodcommented, May 27, 2016

@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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found