Firebase Cloud Firestore throws "client is offline"
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
For me, the same error happened when
- project_id is wrong
- port for emulator is 8081 instead of 8080. (when port was 8081 the emulator was working well, with UI opened normally and so on but the error kept showing. I fixed the problem by changing the port back to 8080)
The error message is very misleading.
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.