Firestore不是Vue CLI应用程序中的功能 [英] Firestore is not a function in Vue CLI application

查看:46
本文介绍了Firestore不是Vue CLI应用程序中的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

import * as firebase from 'firebase'
import 'firebase/firestore'
import config from './config'

export const firebaseApp = firebase.initializeApp(config)

export const firestore = firebaseApp.firestore()

在过去的24小时里,我一直在与之抗争,我获得了导入Firebase/firestore的解决方案,但似乎仍然没有一个适合我.

I've been battling this for the past 24hrs, I got solutions to import the firebase/firestore, but still none seems to work for me.

init.js?9adc:10 Uncaught TypeError: firebaseApp.firestore is not a function
at eval (init.js?9adc:10)
at Object.<anonymous> (renderer.js:1309)
at __webpack_require__ (renderer.js:680)
at fn (renderer.js:90)
at eval (199:3)
at Object.<anonymous> (renderer.js:2035)
at __webpack_require__ (renderer.js:680)
at fn (renderer.js:90)
at eval (CustomersTable.vue?2194:1)
at Object.<anonymous> (renderer.js:2022)

推荐答案

npm install --save @firebase/firestore

为我修复了此问题.它在Firebase版本4.5.0和4.8.0之间中断了.

fixed this for me. It broke somewhere between firebase versions 4.5.0 and 4.8.0.

这篇关于Firestore不是Vue CLI应用程序中的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆