'could not reach firebase backend

since I am new to react and firebase i couldn't able to solve this error error

@firebase/firestore: Firestore (9.6.4): Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: FirebaseError: [code=permission-denied]: Permission denied on resource project disneyplus-clone-a33d5.
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.

firebase,js

import { initializeApp } from "firebase/app";
import { getStorage } from "firebase/storage";
import { getAuth, GoogleAuthProvider } from "firebase/auth";
import { getFirestore } from "firebase/firestore";

const firebaseConfig = {
  apiKey: "",
  authDomain: "",
  projectId: "",
  storageBucket: "",
  messagingSenderId: "",
  appId: "",
  measurementId: "",
};

const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
const auth = getAuth();
const storage = getStorage(app);
const provider=new GoogleAuthProvider();

export { auth, storage, provider };
export default db;



import db from '../firebase';
import { doc, onSnapshot, collection, query, where, getDocs  } from "firebase/firestore";

function Home() {

  useEffect(() => {
    const q =query(collection(db, "movies"));
    const unsub = onSnapshot(q, (snapshot) => {
      const tempMovies = snapshot.docs.map((data) => {
        return { id: data.id, ...data.data()}
      })
      console.log(tempMovies);
    })
  
  }, [])

even though i tried many solutions provided but it still not working

I have a stable internet connection and for testing i tried many connections

please someone help me to solve this error.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source