Trying to install firestore v.9 but credentials won't import
This part
const serviceAccount = require('./firestore-reactdb-027d52fa212f.json');
Results in an error:
Module not found: Error: Can't resolve './firestore-reactdb-027d52fa212f.json' in (...)
I downloaded the json file from IAM & admin > Service accounts in the Cloud Platform Console (as instructed here under "initialize on your own server"). I tried also to download the credentials from the console in firebase (project settings -> service account -> generate new private key).
PS: it's in a react app
Those credentials are needed when you make your own service. React app is not a service read about what service is. If you want to use firebase in react app you don't need those secrets. You need firebase config object and you no need to wory about to sharing it. This config object is necesery for firebase to know where he can send requests etc.
Example object with configurations for firebase.
const firebaseConfig = {
apiKey: "...",
authDomain: "...",
projectId: "...",
storageBucket: "...",
messagingSenderId: "...",
appId: "...",
measurementId: "..."
};