Question Detail

firebase app named '[default]' already exists (app/duplicate-app) React-Native

5 years ago Views 6392 Visit Post Reply

I am using Firebase Real-time Database to React Native, I have imported Firebase like

import firebase from 'firebase';

var configure Firebase= {



databaseURL: "",

storageBucket: "",


const fireabaseConfig=firebase.initializeApp(configure Firebase);

export default class HomeScreen extends Component {

//.............Remain Business Logic here...............



after this snippet when I run the code it works fine first time but after some time it gives me the error 

firebase app named '[default]' already exists (app/duplicate-app)

Thread Reply

Hemant Sharma

- 5 years ago

Firebase App named '[DEFAULT]' already exists (app/duplicate-app)

This error occurs when you trying to initialize firebase again and again. It should be initialized at once and use to avoid Firebase app named '[DEFAULT]' already exists  you have to change your initialization style.

import firebase from 'firebase';
try {
databaseURL: "",
storageBucket: "",
} catch (err) {
// we skip the "already exists" message which is
// not an actual error when we're hot-reloading
if (!/already exists/.test(err.message)) {
console.error('Firebase initialization error raised', err.stack)
const firebaseApp= firebase;