I don't know where the problem is and cannot find it in my search, I'm having this firebase initialization:
import firebase from "firebase/compat/app";
import "firebase/compat/firestore";
import "firebase/compat/auth";
const firebaseConfig = {
apiKey: "xxxxxxxxxx",
authDomain: "xxxxxxxxxx",
projectId: "xxxxxxxxxx",
messagingSenderId: "xxxxxxxxxx",
appId: "xxxxxxxxxx",
measurementId: "xxxxxxxxxx",
storageBucket: "xxxxxxxxxx",
};
firebase.initializeApp(firebaseConfig);
firebase.db = firebase.firestore();
firebase.auth = firebase.auth();
export default firebase;
And want to check if in a login form the user is in my users db with:
import firebase from "../Config/firebase";
const onSubmit = async (data) => {
try {
const responseUser = await firebase.auth.singInWithEmailAndPassword(
data.mail,
data.password
);
console.log(responseUser.user.uid);
}
} catch (e) {
console.log("ERROR ", e);
}
};
From that I get this error:
ERROR TypeError: _Config_firebase__WEBPACK_IMPORTED_MODULE_3__.default.auth.singInWithEmailAndPassword is not a function
onSubmit (index):24
handleSubmit (index):992
React 14
unstable_runWithPriority (index):468
React 15
js (index):7
js main.chunk.js:5996
Webpack 7
I can read and write with this firebase set-up already, but cannot check get a reply from the user auth. If anyone has some ideas I would really appreciate it! thanks in advance