Skip to content

[alpha][auth] FirebaseError: Firebase: Error (auth/already-initialized) #4510

Answered by sam-gc
retronav asked this question in Q&A
Discussion options

You must be logged in to vote

This is interesting, thanks for the report. I'm not able to reproduce in vanilla JS using this code:

const app = initializeApp(config);
getAuth(app);
getAuth(app);

But this code fails in a different way:

initializeApp(config);
initializeApp(config);  // Throws FirebaseError: Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app).

Now I'm not sure how the hot reloading works and how global state is preserved / overwritten. I'll play with this a bit more if I find some time.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@retronav
Comment options

@Feiyang1
Comment options

@rosnk
Comment options

@SrijanDas
Comment options

@gusta-of
Comment options

Answer selected by retronav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants