【问题标题】:React Firebase app auth service does not work in productionReact Firebase 应用程序身份验证服务在生产中不起作用
【发布时间】:2020-11-24 16:18:42
【问题描述】:

我已经通过我的网络应用程序上的谷歌帐户设置了一个 React 授权,这在生产中并不能真正工作,但是,在 localhost 上工作。这是来自开发模式的消息(可能会影响):问题是 google 登录模式会立即从屏幕上消失!

It looks like you're using the development build of the Firebase JS SDK.
When deploying Firebase apps to production, it is advisable to only import
the individual SDK components you intend to use.

import firebase from 'firebase/app';
import 'firebase/<PACKAGE>';

这里可能有什么错误和解决方案?我使用实时数据库来修改值(实际上可以正常工作)和 google 帐户的身份验证服务。

【问题讨论】:

    标签: javascript reactjs firebase webpack google-cloud-firestore


    【解决方案1】:

    您收到的错误消息告诉您如何解决问题。问题在于您导入 Firebase SDK 的方式。如果您有以下不同之处,我建议您更改它:

    import firebase from 'firebase/app';
    import 'firebase/storage';//if using Firebase storage, if not, set the right component.
    

    【讨论】:

    • 这样可以吗,firebase 需要很长时间才能启动授权窗口?
    • 最后崩溃了
    【解决方案2】:

    您只需转到 Firebase 控制台并在“登录方法”下,向下滚动到“授权域”选项卡,然后添加您的生产应用域。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-13
      • 1970-01-01
      • 2019-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-18
      • 2011-05-01
      相关资源
      最近更新 更多