Firebase Cloud Firestore throws “client is offline”

前端 未结 8 1547
栀梦
栀梦 2020-12-11 15:14

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 pe

相关标签:
8条回答
  • 2020-12-11 15:34

    Try to use VPN, It will work!. Me i switched to VPN and it worked 100%. Sometimes Firebase fail to respond to IPs addresses of some countries.

    0 讨论(0)
  • 2020-12-11 15:49

    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

    0 讨论(0)
  • 2020-12-11 15:50

    For me, the same error happened when

    1. project_id is wrong
    2. 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.

    0 讨论(0)
  • 2020-12-11 15:51

    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.

    0 讨论(0)
  • 2020-12-11 15:51

    I have just spent about 3 hours trying to fix it. There was something wrong with my emulator. I had to remove it, then created new and now it is working. So if you face this issue, give it try.

    0 讨论(0)
  • 2020-12-11 15:54

    I had some problem. but I've just fixed it. check your projectId is correct. when you use cloud firestore, you need it.

    export const environment = {
      production: false,
      firebaseConfig: {
        apiKey: 'XYZ',
        authDomain: 'XYZ.firebaseapp.com',
        databaseURL: 'https://XYZ.firebaseio.com',
        storageBucket: 'XYZ.appspot.com',
        projectId: 'XYZ' // <--- make sure project ID is here 
      }
    };
    
    0 讨论(0)
提交回复
热议问题