0

I'm trying to use firebase.database.ref() as mentioned in the docs.

firebase.initializeApp(firebaseConfig);
firebase.firestore().settings( { timestampsInSnapshots: true })
// firebase.analytics();

const storage = firebase.storage();
const store = firebase.firestore();
const authenticate = firebase.auth();
    
var matchref = firebase.database().ref("users");

and it's returning this error

firebase_app__WEBPACK_IMPORTED_MODULE_8__.default.database is not a function

I'm using version 8 so this shouldn't be happening.

chackerian
  • 1,301
  • 2
  • 15
  • 29
  • I expect that you forgot to import the Realtime Database SDK. Make sure you include it as shown here: https://stackoverflow.com/questions/38248723/firebase-database-is-not-a-function If that doesn't address the problem, edit your question to show how you **import/include** the SDKs. – Frank van Puffelen Nov 22 '21 at 02:38
  • This is in the same file where I'm initializing the firebase app so I don't know if I have to do that – chackerian Nov 22 '21 at 02:41
  • It's magically working now – chackerian Nov 22 '21 at 03:05

0 Answers0