【问题标题】:Warning "It looks like you're using the development build of the Firebase JS SDK."警告“看起来您正在使用 Firebase JS SDK 的开发版本。”
【发布时间】:2023-03-06 06:17:02
【问题描述】:

目前我收到警告:

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.

For the CDN builds, these are available in the following manner
(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):

https://www.gstatic.com/firebasejs/5.0.0/firebase-<PACKAGE>.js

我已经浏览了几个与此问题相关的链接,但即使遵循了他们的所有解决方案,我也无法消除该错误。 正如描述所说,将给定的链接与我正在使用的组件的名称一起使用。我已经包含了我需要的链接,但我仍然看到警告。

我什至尝试包含 Firebase 网站中提供的所有链接,但我仍然看到它。

目前我只使用 Firebase 实时数据库,但在使用 CMD 创建 firebase init 时,我已经包含了函数、托管、存储和数据库。

<script src="https://www.gstatic.com/firebasejs/5.0.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.0/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.0/firebase.js"></script>

我什至尝试将版本从 5.0.0 更改为 5.4.0,但没有用。 如何解决?

【问题讨论】:

    标签: firebase firebase-realtime-database warnings google-cloud-cdn browser-console


    【解决方案1】:

    我刚刚通过添加两个脚本解决了它。

    &lt;script src="https://www.gstatic.com/firebasejs/5.0.2/firebase-app.js"&gt;&lt;/script&gt;

    &lt;script src="https://www.gstatic.com/firebasejs/5.0.2/firebase-database.js"&gt;&lt;/script&gt;

    【讨论】:

    • 我进行了建议的更改,但仍然收到警告。事实证明,我两次导入了 firebase。确保您也没有将其导入其他地方。 (导入语句不包括脚本)
    猜你喜欢
    • 2020-09-24
    • 1970-01-01
    • 2018-11-22
    • 2021-05-03
    • 1970-01-01
    • 1970-01-01
    • 2019-01-17
    • 1970-01-01
    • 2017-10-25
    相关资源
    最近更新 更多