Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/470.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/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.auth.RecaptchaVerifier不是构造函数错误_Javascript_Firebase_Firebase Authentication - Fatal编程技术网

Javascript firebase.auth.RecaptchaVerifier不是构造函数错误

Javascript firebase.auth.RecaptchaVerifier不是构造函数错误,javascript,firebase,firebase-authentication,Javascript,Firebase,Firebase Authentication,在使用Firebase.initializeApp(config)初始化Firebase应用程序后,尝试在我的html中添加Firebase脚本 那么我有这个: <script> window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('sign-in-button', { 'size': 'invisible', 'c

在使用
Firebase.initializeApp(config)初始化Firebase应用程序后,尝试在我的html中添加Firebase脚本

那么我有这个:

 <script>

          window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('sign-in-button', 
           {
            'size': 'invisible',
            'callback': function(response) {
            // reCAPTCHA solved, allow signInWithPhoneNumber.
            onSignInSubmit();
            }
      });

 </script>
  • 如何解决此错误(发现类似问题而没有直接答案)
  • 如何从这里开始,以充分的流动
  • 编辑

    我在html的开头有以下内容:

      <script src="https://www.gstatic.com/firebasejs/5.7.0/firebase-firestore.js"></script>
      <script src="https://www.gstatic.com/firebasejs/5.7.0/firebase-storage.js"></script>
      <script src="https://www.gstatic.com/firebasejs/3.1.0/firebase-auth.js"></script>
      <script src="https://www.gstatic.com/firebasejs/3.1.0/firebase-database.js"></script>
    
    
    
    我正在使用以下命令初始化应用程序:

     <script>
              var config = {
                apiKey: "AIzaSxxxxxxxxxxxxxxxZQ14",
                authDomain: "xxxxxx.firebaseapp.com",
                databaseURL: "https://xxxxxxx.firebaseio.com",
                projectId: "xxxxxx",
                storageBucket: "xxxxxxx.appspot.com",
                messagingSenderId: "xxxxxxxxx"
              };
              firebase.initializeApp(config);
              const db = firebase.firestore();
              db.settings({timestampsInSnapshots:true});
         </script>
    
    
    变量配置={
    apiKey:“Aizasxxxxxxxxxxxxzq14”,
    authDomain:“xxxxxx.firebaseapp.com”,
    数据库URL:“https://xxxxxxx.firebaseio.com",
    projectId:“xxxxxx”,
    storageBucket:“xxxxxxx.appspot.com”,
    messagingSenderId:“xxxxxxxxx”
    };
    firebase.initializeApp(配置);
    const db=firebase.firestore();
    db.settings({timestampsInSnapshots:true});
    

    这些是我在这个文件中唯一与Firebase相关的内容。

    通过将导入文件的版本更改为:(非常感谢Frank

    
    
    看起来您没有将Firebase Auth SDK导入页面。请确保按照中的步骤进行操作,如果仍然卡住,请使用导入更新您的问题。@FrankvanPuffelen谢谢Frank,在您的链接中,我没有看到任何有关导入的内容,但我编辑了我的问题,显示了我与Firebase相关的所有内容。请坐look@Curnelious你能在下面写下你的答案吗?很好。你能用解决方案添加答案吗?哦,对了,我甚至没有注意到版本不同
     <script>
              var config = {
                apiKey: "AIzaSxxxxxxxxxxxxxxxZQ14",
                authDomain: "xxxxxx.firebaseapp.com",
                databaseURL: "https://xxxxxxx.firebaseio.com",
                projectId: "xxxxxx",
                storageBucket: "xxxxxxx.appspot.com",
                messagingSenderId: "xxxxxxxxx"
              };
              firebase.initializeApp(config);
              const db = firebase.firestore();
              db.settings({timestampsInSnapshots:true});
         </script>
    
          <script src="https://www.gstatic.com/firebasejs/5.7.0/firebase-app.js"></script>
          <script src="https://www.gstatic.com/firebasejs/5.9.0/firebase-firestore.js"></script>
          <script src="https://www.gstatic.com/firebasejs/5.7.0/firebase-storage.js"></script>
          <script src="https://www.gstatic.com/firebasejs/5.9.0/firebase-auth.js"></script>
          <script src="https://www.gstatic.com/firebasejs/5.9.0/firebase-database.js"></script>
          <script src="https://www.gstatic.com/firebasejs/5.9.0/firebase-messaging.js"></script>
          <script src="https://www.gstatic.com/firebasejs/5.9.0/firebase-functions.js"></script>