DEV Community

Discussion on: Server Side Authentication with Firebase and Next.js

Collapse
 
nahue profile image
Victor Nahuel Chaves

This is great! but how do you handle admin.initializeApp throwing "Error: The default Firebase app already exists. This means you called initializeApp() more than once without providing an app name as the second argument. In most cases you only need to call initializeApp() once." ?

Collapse
 
lxnd77 profile image
Rishabh Bhargava

if (!firebase.apps.length) {
firebase.initializeApp(firebaseConfig);
}