I'm using Firebase v9 SDK on a Vue 3 application.
I'm trying to import firebase or firebase/auth,
but it gives me this error.
Where am I trying to use?
In my login form
<script>
import { getAuth, signInWithEmailAndPassword } from "firebase/auth";
export default {
name: "Login",
data() {
return {
email: '',
password: '',
}
},
methods: {
loginForm() {
const auth = getAuth();
signInWithEmailAndPassword(auth, this.email, this.password)
.then((userCredential) => {
console.log(`Successfully signed in as ${this.email}`)
// Signed in
const user = userCredential.user;
console.log(user)
// ...
})
.catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
});
}
}
};
</script>
This is my babel.config.js file
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
I don't know the module bundler, so I can't provide the webpack.config.js file, BUT I'm using Vue JS 3