firebase.firestore() is not a function when trying to initialize Cloud Firestore

前端 未结 21 1551
独厮守ぢ
独厮守ぢ 2020-12-01 02:45

When I try to initialize Firebase Cloud Firestore, I ran into the following error:

Uncaught TypeError: WEBPACK_IMPORTED_MODULE_0_firebase

21条回答
  •  执念已碎
    2020-12-01 03:28

    import { firebase } from '@firebase/app';
    import '@firebase/firestore'
    

    If you're using authentication as well

    import '@firebase/auth';
    

提交回复
热议问题