Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Firebase连接错误_Javascript_Firebase_Firebase Authentication - Fatal编程技术网

Javascript Firebase连接错误

Javascript Firebase连接错误,javascript,firebase,firebase-authentication,Javascript,Firebase,Firebase Authentication,我们使用的是Firebase和React,通常工作正常。但在随机时间,Firebase数据库将无法访问。我们还使用firebase进行身份验证,因此在此期间用户无法登录 错误是 A network error (such as timeout, interrupted connection or unreachable host) has occurred. 这里是登录的代码 signIn() { var provider = new firebase.auth.GoogleAuthP

我们使用的是Firebase和React,通常工作正常。但在随机时间,Firebase数据库将无法访问。我们还使用firebase进行身份验证,因此在此期间用户无法登录

错误是

A network error (such as timeout, interrupted connection or unreachable host) has occurred.
这里是登录的代码

signIn() {
    var provider = new firebase.auth.GoogleAuthProvider();
    provider.setCustomParameters({
         'prompt': 'select_account'
    });
    firebase.auth().signInWithPopup(provider).then(function(result) {
        // This gives you a Google Access Token. You can use it to access the Google API.
        var token = result.credential.accessToken;
        // The signed-in user info.
        var user = result.user;
    }.bind(this)).catch(function(error) {

        // Handle Errors here.
        var errorCode = error.code;
        var errorMessage = error.message;
        console.log(errorMessage);
        // The email of the user's account used.
        var email = error.email;
        // The firebase.auth.AuthCredential type that was used.
        var credential = error.credential;
        // ...
    });
}

有人知道这可能是什么原因吗?

这似乎与firebase的signInWithPopup功能有关。调用该功能时,您的浏览器可能试图打开新选项卡而不是弹出窗口。您必须允许浏览器打开弹出窗口。此外,当出现此问题时,重置浏览器的缓存并允许3的派对cookies,然后重试。最后,如果这些cookies不起作用,则问题源于浏览器的错误。

您是否可以检查浏览器网络控制台以了解何时会发生这种情况,并包括此情况的日志?