【问题标题】:Could not reach Cloud Firestore backend with Angular Universal and Firebase Functions [closed]无法使用 Angular Universal 和 Firebase Functions 访问 Cloud Firestore 后端 [关闭]
【发布时间】:2019-06-01 09:04:54
【问题描述】:

我正在尝试对服务器端的 Firestore 执行一个简单的请求(使用 firebase serve 运行的 Angular Universal):

constructor(private afs: AngularFirestore) {
     this.afs.doc<any>('myData').valueChanges().subscribe(resp => console.log(resp));
}

我遇到了与 Firestore 的连接问题:

error: [2019-01-06T12:26:14.371Z] @firebase/firestore: Firestore (5.5.9): 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.

  • @angular 版本:^6.1.10
  • @angular/fire 版本:^5.1.1
  • firebase 版本:^5.7.2

【问题讨论】:

    标签: node.js typescript firebase google-cloud-firestore angular-universal


    【解决方案1】:

    如果您在开发机器上运行 Kaspersky 防病毒软件,请检查此问题:Issue

    在这种情况下,关闭防病毒程序可能会对您有所帮助。 可能的解决方法: - 首先也是最重要的:您必须检查您的 Firestore 连接详细信息是否有效,以及您的应用程序是否真的在尝试连接到数据库。 - 尝试使用以下命令记录 firestore 错误:firebase.firestore.setLogLevel('debug')。然后,您将能够提供有关您的问题的详细日志,这将有助于解决问题。 - 您是否能够从 firebase 控制台中的同一台机器访问数据库? - 您是否提供 --prod 构建服务?如果不尝试,看看问题是否消失。

    【讨论】:

    • 不幸的是,事实并非如此。从浏览器(在同一台机器上)请求有效..
    猜你喜欢
    • 2020-02-01
    • 2018-09-15
    • 2021-08-23
    • 2021-08-13
    • 1970-01-01
    • 2020-09-02
    • 2022-08-04
    • 2019-11-14
    • 2023-03-11
    相关资源
    最近更新 更多