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:
- Created 6 years ago
- Comments:8 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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());
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.