firebase-functions icon indicating copy to clipboard operation
firebase-functions copied to clipboard

Error:FIREBASE FATAL ERROR:Can't determine Firebase Database URL.

Open Jahanzai6 opened this issue 6 years ago • 2 comments

error I am making a simple messageboard app with react native which is connected to firebase. I am initializing firebase as:

import * as firebase from 'firebase';

var firebaseConfig = {

apiKey: "AIzaSyCwILI7iQP9fs5ElhZrVsCfUVRAfgNgpXU",
authDomain: "messageboard-5b65f.firebaseapp.com",
databaseURL: "https://messageboard-5b65f.firebaseio.com",
projectId: "messageboard-5b65f",
storageBucket: "messageboard-5b65f.appspot.com",
messagingSenderId: "993406520031",
appId: "1:993406520031:web:a56bc0b98453ea8d39776a",
measurementId: "G-SWH7GRQYXM"

};

if (!firebase.apps.length) {
firebase.initializeApp({});

} const database = firebase.database();

But everytime I am getting the error shown below:

Error:FIREBASE FATAL ERROR:Can't determine Firebase Database URL.Be sure to include databaseURL option when calling firebase.initializeApp().

Jahanzai6 avatar Feb 29 '20 08:02 Jahanzai6

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Feb 29 '20 08:02 google-oss-bot

You are initializing the Firebase SDK with an empty object: firebase.initializeApp({}). It seems like it should be firebase.initializeApp(firebaseConfig)

mbleigh avatar Mar 05 '20 20:03 mbleigh