I'm trying to push an object to the firebase database, but the push() method isn't working and it seems likely it has something to do with the warning I'm getting:
@firebase/database:, FIREBASE WARNING: Firebase error. Please ensure that you spelled the name of your Firebase correctly (https://<DATABASE_NAME>.firebaseio.com)
However it matches databaseURL in the config I have in the App.js
const config = {
apiKey: "<...>",
authDomain: "<...>.firebaseapp.com",
projectId: "<...>",
storageBucket: "<...>.appspot.com",
messagingSenderId: "<...>",
appId: "<...>",
databaseURL: "https://<...>.firebaseio.com",
};
firebase.initializeApp(config);
The method I use to get access to the database:
const { currentUser } = firebase.auth();
console.log(currentUser.uid); // works fine
firebase
.database()
.ref(`/users/${currentUser.uid}/cards`)
.push({some object})
I'm using Database location: Belgium (europe-west1) if that matters. And firebase authentication works fine.
config
snippet from? I get the correct URL in my tests and if this is a bug I'd love to get it fixed. – EnnuidatabaseURL
which I added afterwards. – Pioneer