小编Dip*_*pti的帖子

Web 应用程序控制台错误:firebase-auth.js:1 未捕获错误:无法实例化 firebase-auth - 请务必先加载 firebase-app.js

我在 Firebase 中创建了一个网络应用项目。并添加了所有 Firebase 配置脚本,包括为项目提供的 api 密钥。我想使用 firebase 将 Google Sign-in 集成到网络应用程序中,并且我遵循了 Firebase Docs 提供的文档。但是 Google 登录按钮不起作用,一旦我加载 index.html,它就会在控制台上抛出这些错误。我已经尝试了所有方法来消除这些错误,但我找不到任何解决方案。请帮忙!

Firebase 网络应用错误

错误:

Cannot instantiate firebase-auth - be sure to load firebase-app.js first. 
Cannot instantiate firebase-database - be sure to load firebase-app.js first.
Cannot instantiate firebase-messaging- be sure to load firebase-app.js first. 
Cannot instantiate firebase-functions - be sure to load firebase-app.js first. 
Run Code Online (Sandbox Code Playgroud)

编辑1:

代码:

<!-- Firebase App is always required and must be first -->
<script src="https://www.gstatic.com/firebasejs/5.3.0/firebase-app.js"></script>

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

<!-- Add additional …
Run Code Online (Sandbox Code Playgroud)

javascript web-applications instantiation vs-web-application-project firebase

3
推荐指数
1
解决办法
4902
查看次数