【问题标题】:Firebase code 400 "message": "CONFIGURATION_NOT_FOUND"Firebase 代码 400“消息”:“CONFIGURATION_NOT_FOUND”
【发布时间】:2021-06-16 12:32:35
【问题描述】:

我目前正在尝试在 Firebase 上创建数据库,但出现以下错误:

{"error":{"code":400,"message":"CONFIGURATION_NOT_FOUND","errors":[{"message":"CONFIGURATION_NOT_FOUND","domain":"global","reason":"invalid"}]}}

我知道这是明智的,但我设置数据库的代码如下:

<script src="https://www.gstatic.com/firebasejs/8.3.1/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.3.1/firebase-firestore.js"></script>

<script>
    // Your web app's Firebase configuration
    // For Firebase JS SDK v7.20.0 and later, measurementId is optional
    var firebaseConfig = {
        apiKey: "AIzaSyAI6HD2Fa35nSL3wqT1u98TgdykPoU1Vvc",
        authDomain: "todo-ca9f2.firebaseapp.com",
        databaseURL: "https://todo-ca9f2-default-rtdb.firebaseio.com/",
        projectId: "todo-ca9f2",
        storageBucket: "todo-ca9f2.appspot.com",
        messagingSenderId: "787961698428",
        appId: "1:787961698428:web:c2af07085cdd3c9ab491f9",
        measurementId: "G-SGPXZS4XET"
    };
    // Initialize Firebase
    firebase.initializeApp(firebaseConfig);
    
    
    const auth = firebase.auth();
    const db = firebase.firestore();

    //firebase.analytics();
</script>
    <script src="app.js"></script>

我在图像上的代码中调用 Firebase:

【问题讨论】:

  • 请不要发布您的代码截图或其他文本内容。而是发布实际文本,并使用 Stack Overflow 的格式化工具进行标记。

标签: javascript html css firebase firebase-realtime-database


【解决方案1】:

错误400与客户端有关。

您的代码应该可以正常工作,因此问题很可能是您尚未在 firebase 控制台的身份验证下启用 登录方法

【讨论】:

  • 谢谢,我在浪费时间寻找解决方案!
【解决方案2】:

转到 firebase 控制台,导航到身份验证并启用 电子邮件/密码。 它应该可以正常工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-03-08
    • 1970-01-01
    • 2018-11-06
    • 2018-11-27
    • 1970-01-01
    • 2020-06-19
    • 2018-12-21
    • 2021-10-06
    相关资源
    最近更新 更多