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

前端 未结 21 1555
独厮守ぢ
独厮守ぢ 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:19

    The problem is not import the firestore

    firebase has many features.

    You need to import or import from the CDN what you want to implement from the list below.

    The official reference says to load firebase-firestore.js.

    
    
    

    if you want to use npm, here

    npm install firebase@7.19.0 --save
    

    url is here
    https://firebase.google.com/docs/firestore/quickstart?authuser=0#set_up_your_development_environment

提交回复
热议问题