title: react-native error RCTJSONStringify() encountered the following error: Invalid type in JSON write (NSURL)
body: <p>I am trying to use <strong>react-native-fbsdk</strong> in my react-native app. It was working fine untill yesterday. But, today it gives a weird error stating <strong>RCTJSONStringify() encountered the following error: Invalid type in JSON write (NSURL).</strong></p>
  
  <p><strong>RN v0.42.0</strong></p>
  
  <p>Here is my code:</p>
  
  <pre><code>  _fbAuth(error, result) {
      if (error) {
        console.log("error");
        alert("login has error: " + result.error);
      } else if (result.isCancelled) {
        console.log("login cancelled");
        alert("login is cancelled.");
      } else {
        AccessToken.getCurrentAccessToken().then((data) =&gt; {
          console.log("login success");
          console.log(data.accessToken.toString());
          let accessToken = data.accessToken;
          alert(data.accessToken.toString());
          const responseInfoCallback = (error, result) =&gt; {
            if (error) {
              console.log(error);
            } else {
              console.log(result);
            }
          }
  
          const infoRequest = new GraphRequest(
            '/me',
            {
              accessToken: accessToken,
              parameters: {
                fields: {
                  string: 'email,name,first_name,middle_name,last_name'
                }
              }
            },
            responseInfoCallback
          );
  
          // Start the graph request.
          new GraphRequestManager().addRequest(infoRequest).start();
        });
      }
    }
  
    render() {
      console.log("in new render");
      return (
        &lt;View style={styles.container}&gt;
        &lt;LoginButton
          publishPermissions={["publish_actions"]}
          onLoginFinished={this._fbAuth}
          onLogoutFinished={() =&gt; alert("logout.")}/&gt;
        &lt;/View&gt;
      );
    }
  </code></pre>
  
  <p>The error information printed in debugger: </p>
  
  <p><a href="https://i.stack.imgur.com/OmUSV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/OmUSV.png" alt="Error message"></a></p>
  
  <p>I get the above error while calling the graphAPI in the function <strong>responseInfoCallback</strong>. Any ideas what is happening ?</p>
  
  <p><strong>Update 1:</strong></p>
  
  <p>This error happens only when remote debugger is turned on!! Else it is not happening. But without remote debugger, I cannot proceed with developing the app. Are there any other methods to see log statements of react-native app other than remote debugger ?</p>
  
  <p><strong>Update 2:</strong></p>
  
  <p>The RCTJSONStringify() error happens only behind proxy. And also https fetch calls does not work under proxy. I tested in an open network, it works fine. I guess, it is to add some proxy information to RN app. I think it is related to <a href="https://facebook.github.io/react-native/docs/running-on-device.html#app-transport-security" rel="noreferrer">APP transport security</a></p>