I am getting this error when i am exporting modules from file A and importing in file B and when i am running file B it gives that error.that is related to Firebase cloud Firestore.
const mailEvents = (startTime, endTime) => {
serverRef = db.collection("MailEvents");
let getDocs = serverRef
.where("timestamp", ">=", startTime)
.where("timestamp", "<=", endTime)
.get()
.then(querySnapshot => {
if (querySnapshot) {
let docs = querySnapshot.docs.map(doc => doc.data());
console.log(docs)
}
});
}
mailEvents();
module.exports.mailEvents = mailEvents;
and the main.js file is
const module = require('./report.js')
module.mailEvents(1575225929,1575305012);