警告“看来您正在使用Firebase JS SDK的开发版本"在Angular Firebase应用程序中 [英] Warning "It looks like you're using the development build of the Firebase JS SDK" in Angular firebase app
本文介绍了警告“看来您正在使用Firebase JS SDK的开发版本"在Angular Firebase应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的角度项目中使用了角度火SDK.但是它会触发以下警告.我搜索了这个问题并获得了答案.但是这些答案不适用于有角度的项目.
I'm using angular fire sdk in my angular project. But it trigger following warning. I searched about this problem and get answers. But those answers cannot apply to angular project.
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 module builds, these are available in the following manner
(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):
CommonJS Modules:
const firebase = require('firebase/app');
require('firebase/<PACKAGE>');
ES Modules:
import firebase from 'firebase/app';
import 'firebase/<PACKAGE>';
Typescript:
import * as firebase from 'firebase/app';
import 'firebase/<PACKAGE>';
- 警告:您似乎正在使用Firebase JS SDK的开发版本
- 如何停止警告:您似乎正在使用Firebase JS SDK的开发版本?
- 在浏览器中加载应用程序(角度v5)时,Firebase JS SDK警告
- 如何避免Firebase警告我正在使用开发版本?
我的应用程序模块如下所示.
My app module looks like this.
import {AngularFireModule} from '@angular/fire';
import {AngularFireAuthModule} from '@angular/fire/auth';
imports:[
...
AngularFireModule.initializeApp(environment.firebaseConfig),
AngularFireAuthModule,
]
我想在我的有角度的项目中停止此警告.
I want to stop this warning in my angular project.
推荐答案
最后我找到了解决方案.
Finally i found a solution.
这是导入Firebase的错误方式
This is Wrong Way to import firebase
import {auth} from 'firebase';
这是导入Firebase的正确方法
And This is Correct Way to import firebase
import * as firebase from 'firebase/app';
这篇关于警告“看来您正在使用Firebase JS SDK的开发版本"在Angular Firebase应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文