问题
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>';
- Warning: It looks like you're using the development build of the Firebase JS SDK
- How to stop the warning: It looks like you're using the development build of the Firebase JS SDK?
- Firebase JS SDK warning while load application in browser (angular v5)
- How to avoid Firebase warning that I’m using the development build?
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.
回答1:
Finally i found a solution.
This is Wrong Way to import firebase
import {auth} from 'firebase';
And This is Correct Way to import firebase
import * as firebase from 'firebase/app';
来源:https://stackoverflow.com/questions/62219946/warning-it-looks-like-youre-using-the-development-build-of-the-firebase-js-sdk