"Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app)." code example
Example 1: Firebase: Firebase App named '[DEFAULT]' already exists
if (!firebase.apps.length) {
firebase.initializeApp({});
}else {
firebase.app();
}
Example 2: Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app).
if (!firebase.apps.length) {
firebase.initializeApp({});
}
Example 3: Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app).
if (!firebase.apps.length) {
firebase.initializeApp(firebaseConfig);
}