question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: An AuthUI instance already exists for the key "[DEFAULT]"

See original GitHub issue
  • Operating System version: Cordova, Android, iOS
  • Firebase SDK version: 4.4.0
  • Firebase Product: phone number auth

I am trying to get Firebase PhoneNumber Auth work in Cordova app based on MeteorJS. Meteor is a single-page app framework that dynamically renders the DOM on the client.

I placed the Firebase UI widget on a bootstrap dialog which is created when the user wants to authenticate. This works for the first time. But if the user dismisses my dialog and opens it again, Firebase throws this exception:

Error: An AuthUI instance already exists for the key "[DEFAULT]"

It seems as if the UI framework doesn’t expect that a widget will be mounted more than once over time. But in an SPA, this is quite normal. How can a workaround this limitation?

Is it possible to destruct the widget programmatically somehow?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

155reactions
bvamoscommented, Jan 31, 2019

To avoid this error I do this in the constructor of my Login page component: this.ui = firebaseui.auth.AuthUI.getInstance() || new firebaseui.auth.AuthUI(firebase.auth());

5reactions
bojeil-googlecommented, Sep 25, 2017

This is a duplicate of a previous issue that was solved. We added a global getter for a UI instance already and we added a delete option to allow you to delete an existing UI instance (ui.delete()) and initiate a new UI instance. It is documented in the README.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in mounted hook: "Error: An AuthUI instance already ...
I building a single page app using Vuejs and using Firebase for authentication. So far I got sign in and sign up to...
Read more >
Error an Authui Instance Already Exist - Lua Software Code
Error: An AuthUI instance already exists for the key "[DEFAULT]". Solution. const ui = firebaseui.auth.AuthUI.
Read more >
An AuthUI instance already exists for the key "[DEFAULT]"
Error: An AuthUI instance already exists for the key "[DEFAULT]". Public note. This is caused by calling ui.start() multiple times.
Read more >
An AuthUI instance already exists for the key "[DEFAULT] ...
SPAでFirebase AuthUIを扱う際に. Error: An AuthUI instance already exists for the key "[DEFAULT]". と表示されることがある。
Read more >
Error: An AuthUI instance already exists-Vue.js
Coding example for the question Error in mounted hook: "Error: An AuthUI instance already exists-Vue.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found