'firebase.auth is not a function' error after SDK update

前端 未结 2 1169
天命终不由人
天命终不由人 2021-01-25 17:19

I am using the Firebase JS sdk for the web without any problems for a year now. After updating my code from the version 5.3.1 to use the latest 6.5.0 S

2条回答
  •  后悔当初
    2021-01-25 18:03

    As explained in the doc (Tab "From the CDN"), importing firebase-app.js only is not sufficient: you need, in addition, to import all the libraries of the Firebase products you want to use (Firebase Auth, Firestore, etc...).

    So, in your case, you should do as follows:

    
    
    

    where X.Y.Z is the version number of the libraries, i.e. 6.6.1 at the time of writing.

提交回复
热议问题