-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
response.json() hangs when chrome debugging #6679
Comments
cc @martinbigio we were talking about this Do sourcemaps in redbox work for you on Android when you're connected to the debugger? |
Now that you mention it, nope, sourcemaps in redbox are not working when connected to the debugger. |
Got the same problem on linux with the v0.22 as well. Interacting with the debug menu breaks the logjam. For me, sourcemaps stop working after a while and I start seeing the transpiled code. That is happening when this error is occurring. But the problem also happens after a reboot before the sourcemaps stop working. From Stackoverflow: http://stackoverflow.com/questions/36262456/what-could-be-causing-this-slow-fetch-in-react-native In the following code, the first console.log message prints pretty much instantly. Then everything just hangs (I'm initially assumed it was waiting for the body of the response to be returned). The Body of the response is only about 26K, the time waiting seems to be indefinite UNLESS, I shake the phone and interact with the debug menu. * As soon as I interact with the debug menu, the promise resolves and everything moves along as expected.* My interactions with the debug menu can be simple, like hide inspector, show inspector, just takes something to kick the promise resolution into gear and everything is fine.
Note: And yes, I have rebooted the computer. |
@steveluscher you were looking into @cpojer, @skevy have we recently made any change to the Promise implementation? cc @bestander, @vjeux |
I've been seeing ‘ |
Takes more than opening the menu, you have to choose something from it, like hide/show inspector. I'm not using a simulator. |
I'm having the same issue on an S4 mini, except I can stop the behaviour by tapping the screen without opening the debug menu. |
Got same issue with
Quick workaround is to add empty timeout execution: fetch('http://example.com')
.then(response => {
setTimeout(() => null, 0);
return response.text();
})
.then(response => {
console.log(response);
}); |
I can confirm just tapping anywhere on the screen does work around this problem. |
Do we know when this regression started repro-ing? Do you guys mind sharing which version of react-native you're using? I want to make sure this is not a regression of the current RC. cc @bestander |
It was in a version installed from npm on March 24. I don't know the version at the moment, but I can look it up tonight. |
I have the same problem with 0.22 and iOS on my mac (installed 1 hour ago). Tapping anywhere + the setTimeOut workaround does not work for me. |
So this may have been introduced on 0.22, so not 0.23 launch blocker though we should fix asap. |
This is due to our incomplete XHR2 implementation. Check this code that was added with cbc0e21. Please consult the spec before fixing stuff. |
Summary:Fixes #6679 This adds support for the missing response types to XMLHttpRequest. Don?t ship this yet. This is completely untested. yolo and stuff. Closes #6870 Reviewed By: bestander Differential Revision: D3153628 Pulled By: davidaurelio fb-gh-sync-id: 76feae3377bc24b931548a9ac1af07943b1048ac fbshipit-source-id: 76feae3377bc24b931548a9ac1af07943b1048ac
Should this be fixed in 0.24? The problem persists for me with 0.24 |
No, this is in 0.25-rc |
Is it fixed in v0.25.0-rc? Because it persists there as well... |
Actually the commit is supposed to be in 0.24.1, it has been cherry-picked into the branch https://github.com/facebook/react-native/commits/0.24-stable. |
yes - I still reproduce the error with 0.24.1 - Am I supposed to to do any changes to my code? I have not changed it since it broke around 0.22. |
It seems something is off with the sourcemap, the one from my bundle has multiple sections but it seems that when we parse it we expect to be flat https://github.com/facebook/react-native/blob/master/Libraries/JavaScriptAppEngine/Initialization/SourceMap.js#L1086
|
@jrichardlai oh yes, that’s a super old version of the source map library. Using what we have in node_modules should do the trick. PR welcome. Will look into the other issue now. |
i have same problem to, i use 0.25.1 and fetch problem not resolve for now. i think fetch is important part to use web service in mobile app and need to fix. |
Any update on this issue? Possible workarounds besides just tapping on the screen.
|
Looking for an update. I have upgraded to:
|
Having this issue as well. Very frustrating. |
How does one debug React Native apps that fetch JSON? 😭 @lacker can you please re-open as this is again an issue |
@danawoodman debug? Well make log lines everywhere to the console And see where iT reaches like for Every line a console.log("1"); And count up And see which logs arent found And you Got the issue where Its stuck. Use above workarounds to fix it. As there is No generaal fix for this issue. |
This error still exists RN 45.1 |
@cablegunmaster yes, what I am saying is that without a hack you cannot troubleshoot your apps since the debugger causes this issue to fail with fetch. |
I was also pulling my hair over this. Glad I've found this issue! |
Didn't encounter this issue before, but once i upgrade from 0.44.0 to 0.46.0 today it pops up. The response.json() is just stuck, doesn't invoke then() nor catch(). Like some said, the fetch() was called from a helper function defined outside of a React component, but is called by a react component. |
Encounter this issue sometimes only through React Native versions 0.44, 0.45 & 0.46. What would I do without these updated issues on Github and user submitted work around? 👍 |
Yay, this appears to be fixed in 0.47 by 6482538 ! |
I too had faced same issue while debugging on ios Emulator with react-native version: "0.46.4". But as @mikelambert suggested, upgrading to version "^0.47.0-rc.5" solved this issue |
but it still hangs on android devices. |
i'm still seeing fetch on android devices being really slow. i'm on 0.49 |
It's probably not slow, tap the screen and it will go fast.
…On Sun, Aug 20, 2017 at 9:52 PM, Charles Lee ***@***.***> wrote:
i'm still seeing fetch on android devices being really slow. i'm on 0.49
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6679 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGepnnp5aS-0Xc7a5-5SGyCarECCAvtks5saPDqgaJpZM4H5YHZ>
.
|
of course, why didn't i think of that |
Cause it is so unobvious and is such a new bug (no wait, it's more than 2
years old....)
…On Sun, Aug 20, 2017 at 9:57 PM, Charles Lee ***@***.***> wrote:
of course, why didn't i think of that
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6679 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGepjJ16GFnf9exbcTSKdN9eCynJEDJks5saPINgaJpZM4H5YHZ>
.
|
@mikelambert nah... Fixed only for ios, android still broken. |
@reactjs-bot @mikelambert I am still following this post as it seems for me just a stupid bug which should be squashed ages ago, but nobody has/takes the time to do so. #android |
wtf i spent 12 hours trying to adjust my code, wondering why it wont go within a .then statement of a promise only to find out its a freakin bug |
Sadly, we get so used to the platform working that when the platform fails
us, we waste a lot of time on it. And it's fixed in the next release is
beginning to sound like the repeating chorus of song that just won't end.
…On Sat, Aug 26, 2017 at 1:04 AM, Penandweb ***@***.***> wrote:
wtf i spent 12 hours trying to adjust my code, wondering why it wont go
within a .then statement of a promise only to find out its a freakin bug
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6679 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGeph4seX9aXKGw2gVUfys4u39iKzs_ks5sb7WEgaJpZM4H5YHZ>
.
|
you can always make your own pull request to address the issue |
After my experience with the jest team, no thanks. Why waste my time to be
told, "I don't want to include a dependency, I'm just going to copy the
code from that dependency code into my project" (I believe the phrase was
"vendor it in").
…On Sat, Aug 26, 2017 at 7:58 AM, JasonHenson ***@***.***> wrote:
you can always make your own pull request to address the issue
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6679 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGepgdYGEqDCmtYiUakfnJuPX4lRsdRks5scBaIgaJpZM4H5YHZ>
.
|
same here! |
@maxim-c @mikelambert , if this is only fixed for iOS, shouldn't this issue still be open for Android devs? Reading the entire issue, it seems prematurely closed by @lacker , am I wrong? |
Its not fixed on Android, just some nasty work arounds. ( tapping on the screen kind of ) |
This actually still happens on Android, and when using an emulator even tapping the screen doesn't help.. |
Summary: Fixes facebook/react-native#6679 Closes facebook/react-native#8512 Differential Revision: D3503958 Pulled By: donyu fbshipit-source-id: f2102c1051fb3fe1d55ecfa24bed19c8d25224e9
When using fetch to make a get to an external api, and if debugging in chrome is active, then it never reaches the second "then" until there is an interaction with the UI, such as a tap on the screen, but if debugging is turned off then this problem goes away.
Using React Native 0.22
Only occurs on Android (both Genymotion and on device (5.0))
Using a Mac
The text was updated successfully, but these errors were encountered: