You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The getAuth function appears to always initialise a new instance when called. So in a Next.JS app that hot reloads you'll get the auth/already-initialized error.
The getApp method doesn't initialise a new app, it only returns the default or specified app. Combined with getApps, that pattern can be used to do an effective quick check to prevent duplicate instances:
There doesn't appear to be a method for checking for existing instances before calling getAuth and I suspect the problem is the same for firestore, database etc. as the documentation suggests they also create a new instance when called.
The text was updated successfully, but these errors were encountered:
Describe your environment
Describe the problem
The
getAuth
function appears to always initialise a new instance when called. So in a Next.JS app that hot reloads you'll get theauth/already-initialized
error.The
getApp
method doesn't initialise a new app, it only returns the default or specified app. Combined withgetApps
, that pattern can be used to do an effective quick check to prevent duplicate instances:There doesn't appear to be a method for checking for existing instances before calling
getAuth
and I suspect the problem is the same for firestore, database etc. as the documentation suggests they also create a new instance when called.The text was updated successfully, but these errors were encountered: