react-native-debugger
react-native-debugger copied to clipboard
Unsupported BodyInit type - RN 0.54
With React Native 0.54, when the option Enable Network Inspect is turned on, you would get Uncaught Error: unsupported BodyInit type
, this may have something to do with how blob
s changed in 0.54.
React Native Debugger app version: 0.7.13 React Native version: 0.54.1 Platform: iOS & Android Is real device of platform: Yes Operating System: macOS
I"m getting the same issue.
I’m seeing this issue with plain Chrome.app DevTools as well btw, so not just an issue with this app.
React native bugs. Not debugger.
maybe this could help https://github.com/Kureev/react-native-network-proxy
Fixed in #217. I'll release the new version later.
Unfortunately I’m still running into the same issue (I’m on RN 0.54.2 btw)
Alas I don’t have time to debug right away, but if this turns out to work for most other people then I’ll definitely try to find some time to debug on our end.
Thank you for pushing this fix so quickly!
I'm running 0.7.16 which should have fixed this issue with #217, but I am still seeing the same error as above. Let me know if I can help resolve this.
RN 0.54.2 Android development, actual device. MacOS
Interestingly it works for me if I enable the network inspector after the first request.
Due to we call the method
after import application script, so some fetch
calls on global scope will be failed.
I just realized this mistake 🙈, I guess it may be the same as your case. @alloy @jehartzog
Just gave it a try and unfortunately it does not work for me. I am running 0.7.17 and RN 0.54.2. Also toggling the inspection after the first request as described by @alloy doesn't work.
Let me know if I can help.
@toytonic could you provide an example code?
I must correct myself. Toggling after the first request DOES indeed work. Apparently there was an server issue on our end when debugging this. Sorry for the confusion.
However the issue persists when toggling it on before the first request or after a live reload.
We are using this library for our requests: https://github.com/KnisterPeter/pretend
Which internally just uses the (native) fetch api.
Just gave the update a try and I’m also still seeing the problem under certain conditions:
- Launch app
- Enable Network Inspect
- Open first RN view that makes a fetch
- Receive
Unsupported BodyInit type
error on all views that make fetches - Reload JS (Command-R)
- Now all fetches keep working
You can try this with the example app in our RN repo, but you will need to create an account with artsy.net
Thanks for the examples!
I think the issue of first request wil be fixed by https://github.com/jhen0409/react-native-debugger/commit/792549a400329159fbd768439b2d2f02a95f5095. I haven't yet release a new version but you can try it first by follow the documentation. Let me know if it's fixed for you.
Yup that’s it! Works perfect now 👍
Thanks for the fast fixes 👏
@jhen0409 any plan to get a release for this fix?
@sibelius I think v0.7.18
already included my all fixes, is that still have the bug for you?
this is breaking on 0.7.18
when we add this to our entry .js file
global.XMLHttpRequest = global.originalXMLHttpRequest ?
global.originalXMLHttpRequest :
global.XMLHttpRequest;
global.FormData = global.originalFormData ?
global.originalFormData :
global.FormData;
without this, it works, but we can't inspect network
We are also seeing this issue still. @sibelius comment works, however, we can't see the network requests either.
@sibelius I removed such code from our codebase and instead started using the contextual menu in the debugger app to enable network inspecting.
this is the contextual menu, gonna try again, and let your guys know
I have an issue with 0.7.18 version, If I enable "Network inspect" in contextual menu.
fetch.js:231 Uncaught Error: unsupported BodyInit type
react-native: 0.55.2 OS: Ubuntu 17.10
Same issue with react-native-debugger 0.7.18
, react-native 0.55.2
, macOS 10.13.4
@alloy's solution worked for me as well
One possible difference I have been noticing is that maybe it’s due to RN version? We’re on RN 0.54
After the query,
body = Blob {size: 609, type: "application/json"}
And the conditional its not able to match its prototype,
Still seeing the issue in 0.54.4, fails if the network inspector is enabled from load, doesn't log any network activity if enabled post launch.
i can see this issue after i updated from 0.48.2 to 0.55.3
react-native:0.55.3
React Native Debugger 0.7.18
I can see this issue after i updated rn from 0.48.2 to 0.55.3...
And then , i see the code where error be throw in fetch.js
...
So i do this...
fetch(url, {
method: 'GET',,
headers,
body:' ' //the code i added
}
And then enable the network... Luckily,everything were be ok~~
What is intriguing is that after i deleted the code body:' '
,there is no error more.
this is working for on 0.53.3 using this https://github.com/jhen0409/react-native-debugger/issues/209#issuecomment-379917990