Home > database >  'getDoc' is not exported from 'firebase/firestore'
'getDoc' is not exported from 'firebase/firestore'

Time:11-02

I'm trying to use firebase hooks with firebase 8.0.0 I keep getting this error : 'getDoc' is not exported from 'firebase/firestore'. Can anyone point out what I'm doing wrong? Thanks.

CodePudding user response:

The top-level getDoc function was introduced in version 9 of the Firebase SDK. In version 8 and before, you'd use the something like firebase.firestore().doc("path/to/your/doc").get() to do the same.

Also see the Firebase documentation on getting a document in version 8 the JavaScript SDK.

  • Related