I have been closely following a tutorial on Vue.js app development from this link. The guide instructed me to add a login() function in the block of the Login.vue file. Here is the snippet of code provided:
login() {
fb.auth.signInWithEmailAndPassword(this.loginForm.email, this.loginForm.password).then(user => {
this.$store.commit('setCurrentUser', user)
this.$store.dispatch('fetchUserProfile')
this.$router.push('/dashboard')
}).catch(err => {
console.log(err)
})
}
Unfortunately, upon compilation, I encountered an error message:
./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/Login.vue
Module build failed: SyntaxError: C:/Users/Rohit/Documents/Javascript/vue_practice/humanity/src/components/Login.vue: Unexpected token, expected ; (33:8)
31 | const fb = require('../firebaseConfig.js')
32 |
> 33 | login() {
| ^
34 | fb.auth.signInWithEmailAndPassword(this.loginForm.email, this.loginForm.password).then(user => {
35 | this.$store.commit('setCurrentUser', user)
36 | this.$store.dispatch('fetchUserProfile')
@ ./src/components/Login.vue 4:0-105 5:0-118
@ ./src/router/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js
I've been troubleshooting to identify and resolve the syntax error, but so far, I haven't had any success. Any assistance or guidance would be greatly appreciated. Thank you!