-
Notifications
You must be signed in to change notification settings - Fork 29.4k
Description
I started a project based on https://github.com/zeit/next.js/tree/v3-beta/examples/with-firebase
The error I have when importing firebase in more than one component.
In this firebase start file:
`import firebase from 'firebase'
const firebaseConfig = {
apiKey: "fdsfsdfdsf",
authDomain: "fdsfdsfsdfdsf",
databaseURL: "sdfdsfdsf",
projectId: "dsfdsfdsf",
storageBucket: "dsfdsfdsf",
messagingSenderId: "dsfdsfsdfdsf"
}
const FbApp = firebase.initializeApp(firebaseConfig)
export default FbApp.auth()`
Then in the components:
import firebase from '../lib/firebaseClient'
With a single component works well, but if I add a new component with import firebase from '../lib/firebaseClient'
the application fail:
Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app).
FirebaseError: Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app).