Encountering an issue in a Vue component while attempting to import another JavaScript file located in the services/AuthenticationService directory.
Error message: Module not found: Error: Can't resolve '@/services/AuthenticationService'. To resolve this, you can try running: npm install --save @/services/AuthenticationService
I have tried looking for solutions to this problem without success. Any assistance would be greatly appreciated.
The view component causing this error is register.vue.
<template>
<div>
<h1>Register</h1>
<input type="email" name="email" v-model ="email" placeholder="email"> <br>
<input type="password" name="password" v-model ="password" placeholder="password"> <br>
<button @click="register">
Register
</button>
</div>
</template>
<script>
import AuthenticationService from '@/services/AuthenticationService'
export default {
data () {
return {
email: '',
password: ''
}
},
methods: {
async register(){
const response = await AuthenticationService.register({
email: this.email,
password: this.password
})
console.log(response.data)
}
}
}
</script>
<style scoped></style>