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

Firestore not return get() Promise #533

Closed
bhram opened this issue Feb 26, 2018 · 1 comment
Closed

Firestore not return get() Promise #533

bhram opened this issue Feb 26, 2018 · 1 comment

Comments

@bhram
Copy link

bhram commented Feb 26, 2018

[REQUIRED] Describe your environment

  • Operating System version: react native
  • Firebase SDK version: ^4.9.1
  • Firebase Product: Firestore

[REQUIRED] Describe the problem

the promise not return 'Loading' or 'Error' ,
it's keep in promise not return any resolve or reject, in get() or set() or update()
when i try in reactjs web it's work fine but in react native not work !!!
*note the collection and doc is exists and it's work in web

 try {
    const snap = await firebase.firestore().collection('users').doc('test').get();
    console.log('Loading ');
  } catch (error) {
    console.log('Error');
  }
@mikelehen
Copy link
Contributor

Is this Android? You're probably hitting #283. Can you try the suggested workaround (at the beginning of your code, before you use Cloud Firestore):

const originalSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function(body) {
  if (body === '') {
    originalSend.call(this);
  } else {
    originalSend.call(this, body);
  }
};

There's a pull request to fix this in React Native, but it hasn't been merged yet: facebook/react-native#17940

@firebase firebase locked and limited conversation to collaborators Oct 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants