u12206050 / gridsome-firebase-starter

Frontend Starter for Gridsome & Firebase using Firesync
48 stars 7 forks source link

this.$db is not a function #16

Open mangomkt opened 4 years ago

mangomkt commented 4 years ago

When I try to use this.$db.collection('events').get().then(snapshot => console.log(snapshot.size))

I get this.$db is not a function

It seems the mounted is running before firebase is up and running

u12206050 commented 4 years ago

Have you tried using the onInit function instead? It fires when the firebase connection is established.

mangomkt commented 4 years ago

@u12206050 OK I will try that.... another thing I noticed is when I deploy the site (I am using netlify) it seems there is some kind of cache... I make an update to the firestore and it is not showing unless I redeploy