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