wch
wch

Reputation: 304

Uncaught (in promise) FirebaseError: Quota exceeded. ReactJS

I got this error while developing a React application:

Uncaught (in promise) FirebaseError: Quota exceeded.

Below I wrote on which line in the console this error is shown:

  const fetchProduct = async () => {
  const querySnapshot = await getDocs(collection(db, "langcards-db"));
  const arr = [];
  querySnapshot.forEach((doc) => {
    arr.push({
      ...doc.data(),
      id: doc.id,
    });
  });
  setData(arr);
  setIsLoading(false);

//error in this line
}
 useEffect(() => {
    if(user){
      fetchProduct();
    }else{
      setData([])
    }
  }, []);
 useEffect(() => {
    if(user){
      fetchProduct();
    }else{
      setData([])
    }
  }, [user]);
  useEffect(() => {

      fetchProduct();
  }, [data]);

I checked the console of the cloud firestore, and there are 52k read, I did not have so many requests because I only study and there are no clients and users. Most likely some of my code is not working correctly

Could this be a useЕffect?

I made to track data changes in order to rerender quickly?

console cloud firestore

Upvotes: 0

Views: 1932

Answers (1)

Tachibana Shin
Tachibana Shin

Reputation: 3908

You have run out of Firebase hits today please refer to quotas https://firebase.google.com/docs/functions/quotas

Upvotes: 2

Related Questions