firebase nextjs FirebaseError: Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app). code example
Example: Firebase: Firebase App named '[DEFAULT]' already exists
if (!firebase.apps.length) {
firebase.initializeApp({});
}