I am trying to use Vuefire in Nuxt's fetch method. It works on initial page load, however, if you refresh the browser, it will fail with the following console error:
Here is the relevant code:
async fetch() {
await this.$bind(
'comments',
this.$fireStore
.collection('comments')
.where('photoId', '==', this.photo.id),
{
wait: true
}
)
},
data() {
return {
comments: []
}
},
Anyone have any tips on how I can fix this so it also works if you refresh the browser? I am probably not writing the above code correctly. Thank you!
I don't know what you are trying to do with
this.$bind
, but I guess you can make that work this way:You can check an example in the Nuxt documentation.