About 3 out of 4 times loading the page I get this error from the firestore client SDK (web). This slows development down tremendously. Auth, Realtime DB and Storage work perfectly fine.
Failed to get document because the client is offline.
Is there something I can do about this?
When the device comes back online, Firestore synchronizes any local changes made by your app to the Firestore backend. Note: Offline persistence is supported only in Android, Apple, and web apps. To use offline persistence, you don't need to make any changes to the code that you use to access Firestore data.
By enabling persistence, any data that the Firebase Realtime Database client would sync while online persists to disk and is available offline, even when the user or operating system restarts the app. This means your app works as it would online by using the local data stored in the cache.
Cloud Firestore supports offline data persistence. This feature caches a copy of the Cloud Firestore data that your app is actively using, so your app can access the data when the device is offline. You can write, read, listen to, and query the cached data.
Security & Protection While Firebase does have a CDN, it doesn't offer you distributed denial of service attacks (DDoS) prevention, web application firewall (WAF), or rate-limiting. All of these are incredibly important to prevent malicious actors from breaking your system or stealing your data.
There's currently an interaction between the clients and routing on the backend that results in this problem. As a result the client believes the network is failing and goes offline.
We'll be rolling out a fix for this soon. Exact times I can't promise but this is among our top priority issues to fix.
Thanks for your patience.
I updated all my packages and I ran into this issue.
I enabled offline persistence for my web app and that fixed the problem:
firebase.firestore().enablePersistence()
https://firebase.google.com/docs/firestore/manage-data/enable-offline
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With