Vue router problem: "An AuthUI instance already exists"
See original GitHub issueI have a problem with Vue-router and the firebaseui-web.
The first time I open the login page it works. The second time I get the error:
[Vue warn]: Error in mounted hook: “Error: An AuthUI instance already exists for the key “[DEFAULT]””
Here’s my Login page vue component:
let firebaseui = require('firebaseui')
export default {
data () {
return {}
},
mounted () {
// FirebaseUI config.
let uiConfig = {
signInSuccessUrl: '#/admin',
signInOptions: [
// Leave the lines as is for the providers you want to offer your users.
window.firebase.auth.GoogleAuthProvider.PROVIDER_ID,
],
// Terms of service url.
tosUrl: ''
}
// Initialize the FirebaseUI Widget using Firebase.
let ui = new firebaseui.auth.AuthUI(window.firebase.auth())
// The start method will wait until the DOM is loaded.
ui.start('#firebaseui-auth-container', uiConfig)
},
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Error in mounted hook: "Error: An AuthUI instance already exists
So far I got sign in and sign up to work with no problems. The issue I am having now is with Social...
Read more >Error: An AuthUI instance already exists-Vue.js - appsloveworld
Coding example for the question Error in mounted hook: "Error: An AuthUI instance already exists-Vue.js.
Read more >Developers - Vue router problem: "An AuthUI instance already exists" -
I have a problem with Vue-router and the firebaseui-web. The first time I open the login page it works. The second time I...
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 >Error: An AuthUI instance already exists for the key "[DEFAULT]"
Code. Language: JavaScript. // One-liner that solves this issue: var ui = firebaseui.auth.AuthUI.getInstance() || new firebaseui.auth.
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
@mesqueeb just do:
This worked for me:
Note that I’m not storing anything in
window
.