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

fetch's response.json() promise not getting resolved when debugging in chrome #7381

Closed
akocmark opened this issue May 4, 2016 · 3 comments
Closed
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@akocmark
Copy link

akocmark commented May 4, 2016

Hi there,

I'm trying to run the android version of the sample code on react-native's tutorial page. It runs exactly like expected however, when running the code with chrome debug enabled, the promise returned by response.json() doesn't get resolved.
It will only get resolved when:

  1. I reload the js files.
  2. I close the app and re-open it again.

here's my code snippet

  fetchData() {

    console.log('pre-fetch');
    fetch(REQUEST_URL)
      // .then((response) => response.json())
      .then((response) => {
        console.log('fetch-promise resolution');
        console.log(response.json);
        return response.json();
      })
      .then((responseData) => {
        console.log('response.json-promise resolution');
        // this.setState({
        //   dataSource: this.state.dataSource.cloneWithRows(responseData.movies),
        //   loaded: true,
        // });
      })
      .done();
  }

and here are the screenshots

  1. The app stopped at console.log(response.json);
    Alt text

  2. When reloading the js files (or closing and re-opening the app), you could see that the previous promise returned by response.json() got resolved and stopped again before resolving the new promise
    Alt text

Am I missing something here?
Here is my machine
OS: Mac OSX Yosemite
NodeJS: 4.2.3
Chrome: Version 50.0.2661.86 (64-bit)
React-Native: 0.24.1

Thanks

@damusnet
Copy link
Contributor

damusnet commented May 4, 2016

@facebook-github-bot duplicate #6679

@ghost
Copy link

ghost commented May 4, 2016

@damusnet tells me this issue is a duplicate of #6679. Let's discuss there, closing this one.

@ghost ghost closed this as completed May 4, 2016
@ghost ghost added the Ran Commands One of our bots successfully processed a command. label May 4, 2016
@mkonicek
Copy link
Contributor

mkonicek commented May 4, 2016

Thanks for finding the duplicate @damusnet!

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants