0
votes

I am building a next.js app with firestore as backend and on npm run dev it is giving me this error.

@firebase/firestore: Firestore (7.14.5): Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: FirebaseError: [code=not-found]: 5 NOT_FOUND: The project undefined does not exist or it does not contain an active Cloud Datastore or Cloud Firestore database. Please visit http://console.cloud.google.com to create a project or https://console.cloud.google.com/datastore/setup?project=undefined to add a Cloud Datastore or Cloud Firestore database. Note that Cloud Datastore or Cloud Firestore always have an associated App Engine app and this app must not be disabled. 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.

Anyone who can help with this?

1
Looks like you didn't integrate the SDK into your project correctly.Doug Stevenson
how can i do that?However, I typed npm i --save firebase and it executed without any error.Badmaash
@DougStevenson can you help me plz?Badmaash
Take a look at this article here. It might help you correctly set up your project. medium.com/@muccy/…Waelmas
@Waelmas Thanks! I will definitely go through this and will let you know if it helped.Badmaash

1 Answers

0
votes

npm install [email protected] --save

if (!firebase.apps.length) {
    firebase.initializeApp(firebaseConfig);
    firebase.firestore().settings({ experimentalForceLongPolling: true });
    instance = this;
  } else {
    console.log("firebase apps already running...")
  }

it was worked for me!