Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer able to preview network response bodies after update to 0.6.0 #56

Closed
fossage opened this issue Mar 15, 2017 · 12 comments
Closed
Labels

Comments

@fossage
Copy link

fossage commented Mar 15, 2017

After the recent update to v0.6.0 I can no longer see the preview or raw response body for network responses in the network tab. I can still see all of the request and response headers being logged, but as far as response bodies go, I just see the message, 'This request has no preview available.' in both the 'Preview' and 'Response' tabs.

I have confirmed that, by re-installing v0.5.6, I can once again see the response bodies. If it is of any help, I am using the snippet from the documentation to enable network logging, namely:

global.XMLHttpRequest = global.originalXMLHttpRequest ? global.originalXMLHttpRequest : global.XMLHttpRequest; global.FormData = global.originalFormData ? global.originalFormData : global.FormData;

That aside, this tool is great. Thanks for making it 👍

React Native version: 0.41.2
Platform: iOS
Is real device of platform: No
Operating System: macOSX

@jhen0409
Copy link
Owner

I can reproduce it with fetch, I think it's related to fetch polyfill (whatwg-fetch), as I confirmed the following solutions works fine:

  • Use XMLHttpRequest directly
  • axios

I'll investigate it, thanks!

@jhen0409
Copy link
Owner

It seems like related to Blob, the network inspect works fine when I remove blob response type, this problem seems to start with some Chrome version (v0.6.0 have updated Chrome version).

I think we can just delete window.Blob in debugger worker because currently react-native is not supported it, I'll do this.

@jhen0409 jhen0409 added the bug label Mar 16, 2017
@jhen0409
Copy link
Owner

It should fixed by c1bcb6f and published as v0.6.1.

@chj-damon
Copy link

it happened again.
react-native-debugger version: 0.9.9
react-native version: 0.61.5

@chj-damon
Copy link

chj-damon commented Mar 3, 2020

I've already add this code in app.js

global.XMLHttpRequest = global.originalXMLHttpRequest || global.XMLHttpRequest;
global.FormData = global.originalFormData || global.FormData;

if (window.FETCH_SUPPORT) {
  window.FETCH_SUPPORT.blob = false;
} else {
  global.Blob = global.originalBlob || global.Blob;
  global.FileReader = global.originalFileReader || global.FileReader;
}

I can see the request in network, but I cannot see the response.

@nathantqn
Copy link

I'm having the same problem, cannot open the Apollo Tab either, the Apollo Dev Tool appears and disappears immediately

@darkbasic
Copy link

Same here, I confirm the issue with react-native-debugger 0.10.6 and react-native 0.61.5

@darkbasic
Copy link

I forgot to specify that it breaks network requests alltogether, with the following error:

{
  "graphQLErrors": [],
  "networkError": {
    "name": "ServerParseError",
    "response": {
      "type": "default",
      "status": 200,
      "ok": true,
      "statusText": "OK",
      "headers": {
        "map": {
          "access-control-allow-origin": "*",
          "connection": "keep-alive",
          "content-length": "130",
          "content-type": "application/json; charset=utf-8",
          "date": "Thu, 05 Mar 2020 08:10:37 GMT",
          "etag": "W/\"82-Ur9iysCnuu8dKhUI0luIROzWyMg\"",
          "x-powered-by": "Express"
        }
      },
      "url": "http://192.168.1.49:4000/graphql",
      "_bodyInit": {},
      "_bodyText": "[object Blob]",
      "bodyUsed": true
    },
    "statusCode": 200,
    "bodyText": "[object Blob]"
  },
  "message": "Network error: Unexpected token o in JSON at position 1"
}

@bclynch
Copy link

bclynch commented Apr 13, 2020

Noticing same issue myself outlined by darkbasic. Turning off network debugging allows the apollo tab to work.

After a bit more tinkering, looks like toggling on Disable cache in the network tab fixes it

@darkbasic
Copy link

@bclynch unfortunately I still get the very same error with react-native-debugger 0.11.1 and disable cache (which is by default in latest version).

@darkbasic
Copy link

darkbasic commented Apr 19, 2020

This workaround seems to help: #432 (comment)

@gavin7gomes
Copy link

gavin7gomes commented Mar 19, 2024

Facing the same problem once again using fetch with react-native-debugger version: v0.14.0 and react-native version: 0.72.5.
I can see all of the request and response headers being logged, but not the network responses, I just see the message, 'This request has no preview available.' in both the 'Preview' and 'Response' tab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants