Uncaught TypeError: firebase.auth is not a function

后端 未结 2 1371
臣服心动
臣服心动 2021-01-27 22:10

I try to build an authentification app with firebase (email & password) but i have problem with firebase methods. When I call firebase.auth, they said \"it\'s not a function

相关标签:
2条回答
  • 2021-01-27 22:52

    Firebase products (eg. Auth) also need to be downloaded from the CDN

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

    Reference: https://firebase.google.com/docs/web/setup

    0 讨论(0)
  • 2021-01-27 23:06

    You need to add firebase auth to the js file:

     <!-- Add Firebase products that you want to use -->
      <script src="https://www.gstatic.com/firebasejs/7.6.0/firebase-auth.js"></script>
    

    You can check here for all available products to add:

    https://firebase.google.com/docs/web/setup#available-libraries

    0 讨论(0)
提交回复
热议问题