Currently, I am in the process of developing an application and encountering an issue where I am unable to comprehend a cryptic error message that keeps popping up. If you'd like to see the error itself, you can check it out here.
Below is my form.vue component:
export default {
data(){
return{
typPozemku: "",
firstName: "",
lastName: "",
email: "",
zprava: "",
}
},
methods: {
submitForm(){
const data = {
typPozemku: this.typPozemku,
firstName: this.firstName,
lastName: this.lastName,
email: this.email,
zprava: this.zprava,
timestamp: new Date().getTime()
};
const sendEmail = firebase.functions().httpsCallable('sendEmail');
sendEmail(data)
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
// This is where the error occurs within the browser
});
const db = firebase.database().ref('contacts');
db.push(data)
.then(() => {
console.log('Data added to Firebase');
})
.catch(error => {
console.error(error);
});
}
}
}
Here's a snippet of my Firebase cloud function code:
const functions = require("firebase-functions");
const admin = require("firebase-admin");
const nodemailer = require('nodemailer');
const cors = require('cors')({origin: true});
// Remaining code omitted for brevity
I have exhaustively explored several versions of Firebase to troubleshoot this issue but remain stumped. Any assistance or guidance would be greatly appreciated.