Rahul Dharmaraja
Rahul Dharmaraja

Reputation: 11

@firebase/firestore: Firestore (8.6.3): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds

I am working on react-native app, i couldn't able to connect firebase with react-native.

 @firebase/firestore: Firestore (8.6.3): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.
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. 

please someone help me on this issue.

Upvotes: 1

Views: 423

Answers (1)

Pawan Kumar
Pawan Kumar

Reputation: 604

Change from

// firebase-config.js
import { getFirestore } from 'firebase/firestore';

const db = getFirestore(app);

to

// firebase-config.js
import { initializeFirestore } from 'firebase/firestore'

const database = initializeFirestore(app, {
  experimentalAutoDetectLongPolling: true
})

This should solve the issue.

Upvotes: 1

Related Questions