Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.6k views
in Technique[技术] by (71.8m points)

angular - @firebase/firestore: Firestore (5.0.4): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds

I am working on an Angular 6 project. This is the error I get when I build with --prod flag, host and run. I've been sitting on this for a long time. Initially thought it was probably a problem with the firestore package and i waited. But now updated to firestore 5.0.4, the problem still exists.

[2018-06-04T06:11:47.859Z] @firebase/firestore: Firestore (5.0.4): 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.

app.module.ts

Imports: [
    AngularFireModule.initializeApp(environment.firebaseConfig),
    AngularFirestoreModule
]

app.component.ts

constructor(public afAuth: AngularFireAuth,
          private afs: AngularFirestore,
          private db: AngularFireDatabase) {
    this._currentUser = this.afAuth.authState
      .pipe(
        switchMap((user: any) => {
           if (user) {
            console.log(user);
            return this.afs.collection('users').doc<User>(user.uid).valueChanges();
           } else {
             return Observable.create(null);
           }
        })
      );
}

FYI: Authentication still works.

dependencies firebase 5.0.4 angularfire2 5.0.0-rc.10

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...