[Firebase Nodejs] Error: 9 FAILED_PRECONDITION pls helppppppp Im very desperate now
Ok Im getting tired of spamming repl talk with questions about Firebase. So basically everything is almost done but whenever I try to run my repl (I dont know if you can see it) this error pops up:Error: 9 FAILED_PRECONDITION: The Cloud Firestore API is not available for Datastore Mode projects.
Anyone know whats going on? Here is the code:
const admin = require('firebase-admin');
const serviceAccount = require("./the_service_Account_Key.json")
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "the DB url"
});
const db = admin.firestore();
//The error is raised staring here
async function foo() {
const docRef = db.collection('users').doc('alovelace');
async function foo() {
await docRef.set({
first: 'Ada',
last: 'Lovelace',
born: 1815
});
}
foo();
Anyone know whats going on??
Voters
YodaCode (76)
I found this issue on GitHub. Maybe it can help?
strange, it's working for me...
@Coder100 Wait really?? Are you sure somethings not wrong?
@Coder100 Because its not working for me
One last thing, I realized that everything was running just fine until line @Coder100
which line @Squirrel777
@Coder100 I made my repl public so it would be easier to help, starting at line 11
@Coder100 Nevermind I solved it! Im writing the tutorial rn lol