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

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

    I think I've got it for folks using electron-webpack. Solution was from a post related to importing codemirror. https://github.com/electron-userland/electron-webpack/issues/81

    This worked for me.

    // package.json
    {
      //...
      "electronWebpack": {
        "whiteListedModules": [
          "firebase"
        ]   
      },
      //...
    }
    

提交回复
热议问题