The error appears on line 49! I've already looked to see if it was a spare key and apparently it isn't... I've tried to add a key and I couldn't either, I've tried to put ; And it didn't work either, I don't know what else to try...
I can't find the error at all and I didn't find help with similar errors...
Thanks in advance for your help!
<script type="module">
// Import the functions you need from the SDKs you need
import { initializeApp } from "/firebase-app.js";
import { getFirestore, doc, setDoc, getDoc, collection, addDoc, query, where } from "/firebase-firestore.js";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: "",
authDomain: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: ""
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
const q = query(collection(db, "pacientes"));
const x = query(q, where("cpf", "==", true));
async function GetADocument(){
const querySnapshot = await getDoc(x);
const docSnap = await getDocs(querySnapshot);
querySnapshot.forEach((doc) => {
then(docSnap.exists(pesquisa = cpf))
nome.value = docSnap.data().nome;
endereco.value = docSnap.data().endereco;
bairro.value = docSnap.data().bairro;
cidade.value = docSnap.data().cidade;
uf.value = docSnap.data().uf;
cep.value = docSnap.data().cep;
rg.value = docSnap.data().rg;
cpf.value = docSnap.data().cpf;
nascimento.value = docSnap.data().nascimento;
tel.value = docSnap.data().tel;
cel.value = docSnap.data().cel;
titulo.value = docSnap.data().titulo;
zona.value = docSnap.data().zona;
secao.value = docSnap.data().secao;
pai.value = docSnap.data().pai;
mae.value = docSnap.data().mae;
cath
alert("usuário não encontrado");
});
} // line 49
btnbuscar.addEventListener("click", GetADocument);
</script>