4

Every single tutorial for how to use Firebase with Vue says that in the main.js file I have to add Vue.use(VueFire); which makes sense. But then I just get this message export 'default' (imported as 'VueFire') was not found in 'vuefire'.

I tried using import * as VueFire from 'vuefire' and it didn't give the error message anymore, but it doesn't seem to be using the plugin.

this is the main.js file

import Vue from 'vue'
import App from './App.vue'
import router from './router'

import VueFire from 'vuefire'

Vue.config.productionTip = false

Vue.use(VueFire);

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
A.lex
  • 81
  • 2
  • 5

2 Answers2

17

Older documentation I think. Try this instead.

import { firestorePlugin } from 'vuefire'
Vue.use(firestorePlugin)
skribe
  • 3,595
  • 4
  • 25
  • 36
  • Yes that was the issue thank you so much =) I looked at the vuefire git repo and the export is {rtdbPlugin} for the realtime database which I am using. – A.lex Jun 02 '19 at 22:24
0

just looking at new documentation here https://vuefire.vuejs.org/vuefire/getting-started.html

 import Vue from 'vue' import { firestorePlugin } from 'vuefire'

 Vue.use(firestorePlugin)
Kick Buttowski
  • 6,709
  • 13
  • 37
  • 58
Iklan Hits
  • 81
  • 1
  • 3