nuxt-community / firebase-module

🔥 Easily integrate Firebase into your Nuxt project. 🔥
https://firebase.nuxtjs.org
MIT License
641 stars 98 forks source link

ReferenceError: $fire is not defined #514

Closed NantipatSoftEn closed 3 years ago

NantipatSoftEn commented 3 years ago

Version

@nuxtjs/firebase: firebase: nuxt:

Problem

this is file nuxt.config.js

  modules: [
    [
      "@nuxtjs/firebase",
      {
        config: {
          apiKey: "***************",
          authDomain: "***************",
          databaseURL: "***************",
          projectId: "***************",
          storageBucket: "***************",
          messagingSenderId: "***************",
          appId: "***************",
          measurementId: "***************"
        },
        services: {
          storage: true
        }
      }
    ]
  ],

I'm doing follow this document https://firebase.nuxtjs.org/service-options/storage/

<script>
export default {
  data() {
    return {
      storage: $fire.storage()
    };
  }
<script>

I got the error $fire is not defined can you give me an example and explain please.

Thank you.

teomankirac commented 3 years ago

i've this same issue.

this.$fire.firestore.collection('posts').doc(item).get().then(snapshot => {}

what fixed it for you?

"@nuxtjs/firebase": "^7.6.1", is my version...

thanks!