1
votes

When I fetch data from Firestore it give this error in console

below I have pasted my code In this I am receiving data from Firestore and consoling it to check weather it receive data or not but it is showing error which I have mentioned Below Same code is perfectly running in Microsoft Edge

Error In Console In chrome

@firebase/firestore: Firestore (5.7.0): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds. This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.

    <script src="https://www.gstatic.com/firebasejs/5.7.0/firebase.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.5.5/firebase-firestore.js"></script>
<script>
  var config = {
    apiKey: "AIzaSyAezlP1Y9ofnuiUK50R0t89mLtOR45M4gE",
    authDomain: "vuefirestorelearningapp.firebaseapp.com",
    databaseURL: "https://vuefirestorelearningapp.firebaseio.com",
    projectId: "vuefirestorelearningapp",
    storageBucket: "vuefirestorelearningapp.appspot.com",
    messagingSenderId: "343583592836"
  };
  firebase.initializeApp(config);

var db = firebase.firestore();

db.settings({
  timestampsInSnapshots: true
});
    db.collection('employees').get().then( function(querySnapshot) {
        querySnapshot.forEach(function(doc){
            console.log(doc.data())
})
} )
</script>
1

1 Answers

0
votes
db.collection('/employees').snapshotChanges().subscribe((users => {
      for (const user of users) {
        console.log(user.payload.doc.data())  
      }
    }));

Please use incognito