Grincek
TypeError when using firebase
import firebase from 'firebase/app';
export default {
props: {
authApi: {type: Object, required: true}
},
methods: {
googleSignIn: function() {
const provider = new firebase.auth.GoogleAuthProvider();
console.log(firebase);
firebase
.auth()
.signInWithPopup(provider)
.then((result) => {
const token = result.credential.accessToken;
const user = result.user;
console.log(token); // Token
console.log(user); // User that was authenticated
})
.catch((err) => {
console.log(err); // This will give you all the information needed to further debug any errors
});
}
}
};
import firebase from 'firebase/app';
export default {
props: {
authApi: {type: Object, required: true}
},
methods: {
googleSignIn: function() {
const provider = new firebase.auth.GoogleAuthProvider();
console.log(firebase);
firebase
.auth()
.signInWithPopup(provider)
.then((result) => {
const token = result.credential.accessToken;
const user = result.user;
console.log(token); // Token
console.log(user); // User that was authenticated
})
.catch((err) => {
console.log(err); // This will give you all the information needed to further debug any errors
});
}
}
};
[Vue warn]: Error in v-on handler: "TypeError: firebase_app__WEBPACK_IMPORTED_MODULE_0__.default is undefined"
found in
---> <Auth> at src/controllers/auth.vue
<App> at node_modules/@trikoder/trim/src/js/components/appView.vue
<Root>
[Vue warn]: Error in v-on handler: "TypeError: firebase_app__WEBPACK_IMPORTED_MODULE_0__.default is undefined"
found in
---> <Auth> at src/controllers/auth.vue
<App> at node_modules/@trikoder/trim/src/js/components/appView.vue
<Root>
const firebaseConfig = {
//firebase config stuff
};
initializeApp(firebaseConfig);
const firebaseConfig = {
//firebase config stuff
};
initializeApp(firebaseConfig);
1 replies