2

目前我收到警告:

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,但没有用。如何解决这个问题?

4

1 回答 1

2

我刚刚通过添加两个脚本解决了这个问题。

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

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

于 2018-08-31T10:26:24.340 回答