Maximum cal stack size exceeded error
Unanswered
Orinoco Crocodile posted this in #help-forum
Orinoco CrocodileOP
I built a Google docs clone for which you can find the Github repo here: https://github.com/jevoncochran/google-docs-clone. Everything seeems to work fine locally. However, I have been unable to use the app after deploying with Vercel. As soon as I log in, it takes me to the home page which flashes and then breaks showing the maximum call stack size exceeded error. Any ideas as to how to resolve this? Also, why would this only be happening in prod and not local?
1 Reply
Orinoco CrocodileOP
Possibly, the error can be found in this useEffect?
useEffect(() => {
const q = query(collection(db, `userDocs/${session?.user?.email}/docs`));
const unsubscribe = onSnapshot(q, (querySnapshot) => {
let docArr: Document[] = [];
querySnapshot.forEach((doc: any) => {
docArr.push({ ...doc.data(), id: doc.id });
});
setDocuments(docArr);
return () => unsubscribe();
});
}, [session?.user?.email]);