Failed to get document because the client is offline.
See original GitHub issueI am trying to develop an android app using nativescript and firebase as backend.To use Firebase I am using this plugin. I am trying to use Firestore for my app .I get this error each time I try to start the app.When I used realtime database ,I was easily able to access all the data, so this is not a network or configuration issue. Below is the code I am using to connet firebase and use firestore.
firebase.initializeApp({}).then((data)=>{
console.log(data) //it prints the databaseURL and it is correct.
});
var db = firebase.firestore();
db.collection("users").doc('<docKey>').get().then((doc) => {
if (doc.exists) {
this.data =doc.data();
} else{
this.data ="No such document!";
}
}).catch((error) => {
console.log(error);
});
Error : com.google.firebase.firestore.FirebaseFirestoreException: Failed to get document because the client is offline.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:25 (5 by maintainers)
Top Results From Across the Web
firestore Failed to get document because the client is offline ...
Yes it's the normal behaviour to get an error with get on a collection if the service could not be reached (when online...
Read more >Firebase Cloud Firestore throws "client is offline"
Auth, Realtime DB and Storage work perfectly fine. Failed to get document because the client is offline. Error. Is there something I can...
Read more >Failed to get document because the client is offline.
W/Firestore(25403): This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline...
Read more >[code=unavailable]: Failed to get document because the client ...
The error I keep getting is: FirebaseError: [code=unavailable]: Failed to get document because the client is offline. I have no idea what I...
Read more >"FirebaseError: failed to get document because the client is ...
I'm working on an Ionic-App with multiple tabs. When I run the app in the browser using ionic serve everything runs as it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Did you try Googling it? Please do and provide some pointers here if you have time: https://www.google.com/search?q=com.google.firebase.firestore.FirebaseFirestoreException%3A+Failed+to+get+document+because+the+client+is+offline.&oq=com.google.firebase.firestore.FirebaseFirestoreException%3A+Failed+to+get+document+because+the+client+is+offline
Simply check if you have permissions to access your document. In my case I forgot to set the read permission: