I have a React Native app that uses Firebase for various functions. It was working perfectly for 2 weeks until I got the below error. I haven't changed anything in the App.js
so don't know why this issue would come across.
[DEFAULT]: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app).
Here is my config code placed in my App.js
:
const firebaseConfig = {
apiKey: '<api-key>',
authDomain: '<app-name>.firebaseapp.com',
databaseURL: 'https://<app-name>.firebaseio.com',
projectId: '<project-id>',
storageBucket: '<app-name>.appspot.com',
messagingSenderId: '<messaging-sender-id>',
appId: '<app-id>'
};
firebase.initializeApp(firebaseConfig);
This code only runs if I comment out the firebase code like the below in one of my components:
const { currentUser } = firebase.auth();
console.log(currentUser);
Here is my console.log(firebase.app())
;