Wix and Firebase

Hello wonderful community !

I have integrated firebase in my wixwebsite an i’m fetching/posting data gracefully.

My problem is that, after about 3 minutes of inactivity of the webpage the firebase app seems to vanish causing the further requests to fail. The exact error terminology is:
" Firebase: No Firebase App ‘[DEFAULT]’ has been created - call Firebase App.initializeApp()"
The app was clearly created and initialize as the previous request were functionning

One solution would be to refresh the page everytime the firebase app disappear but it is obviously not user friendly as it cause at least one request to fail…

Any solution / tips would be very much appreciated

I’m no expert in firebase, but from what I could find online, you could do some check before using your firebaseApp

if (firebase.apps.length === 0) {
    firebase.initializeApp({});
}

That’s merely a workaround and I’m also curious to know what that app disappear

I did find that solution and it actually works.
But to be honest it doesn’t seem right to re-initialise app every 3 min :thinking:

Anyway at least the problem is fixed, thank you for your answer