Pascal Luther
1 min readJun 9, 2019

--

Hey Craig Peckett

I think your problem is that in your asyncData method you have two return statements, so you actually never return ‘squad’ and instead return the .get() method/its promises?

Try doing it thee following way using async/await:

async asyncData() {

const squad = []
await const snapshot = db.collection(‘squad’).get()

for (const doc of snapshot.docs) {
let squadItem = doc.data()
squad.push(squadItem)
}
return squad
})
}

! Make sure to write async asyncData. (async comes twice)

Hope that helps and works.

Check out my helper library firewings, it helps me make these queries a little easier for me.

Let me know if this wouldn’t work.

--

--

Pascal Luther
Pascal Luther

Written by Pascal Luther

Cloud Product Architect by day, recreational web-developer by night. Currently a big fan of Vue & Nuxt.js and of going serverless with Google Firebase.

No responses yet