简体   繁体   中英

Redux Firebase: Firebase SDK console

import  * as firebase from 'firebase'


var config = {
  apiKey: "AIzaSyBUyjLkedpKhuxgolrTSjw547k1XkwExcQ",
  authDomain: "posts-2dce0.firebaseapp.com",
  databaseURL: "https://posts-2dce0.firebaseio.com",
  projectId: "posts-2dce0",
  storageBucket: "posts-2dce0.appspot.com",
  messagingSenderId: "575596087223"
};
firebase.initializeApp(config);

export const database = firebase.database().ref('posts/');

Im having an console error here that says: 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 with the name of a component - ie auth, database, etc):

CommonJS Modules: const firebase = require('firebase/app'); require('firebase/');

ES Modules: import firebase from 'firebase/app'; import 'firebase/';

i did try everything but it wont work. Still receiving this console warning

Have you tried:

import firebase from 'firebase/app';
import 'firebase/app';
import 'firebase/firestore';

instead of the 1st line of your code?

Do you import firebase in any other files?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM