Firebase javascript身份验证 - 错误:"未捕获的ReferenceError:未定义firebase"

时间:2017-04-11 03:23:40

标签: javascript firebase error-handling firebase-authentication

这是我写的有问题的代码

firebase.auth().onAuthStateChange(firebaseUser => {
  if(firebaseUser) {
   console.log(firebaseUser);
   } else {console.log('not logged in');
}

是的,我已经从Firebase更改了脚本

1 个答案:

答案 0 :(得分:1)

尝试在您的html中加入<script src="https://cdn.firebase.com/js/client/[version]/firebase.js"></script>