nuxt-community / firebase-module

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

TypeError: store is undefined #275

Closed Epistol closed 4 years ago

Epistol commented 4 years ago

Version

@nuxtjs/firebase: 6.1.1 firebase: 7.17.1 nuxt: 2.14.0

Reproduction Link

https://github.com/Epistol/nuxt-firebase-bug

Steps to reproduce

initAuth.js

store.commit("SET_AUTH_USER", { authUser, claims })

Go to login page

What is Expected?

Not having the error : "Uncaught (in promise) TypeError: store is undefined"

What is actually happening?

Error "Uncaught (in promise) TypeError: store is undefined"

lupas commented 4 years ago

Hey @Epistol As you can see in the Nuxt-Firebase Module documentation, you need to have a vuex store and the respective store actions/mutations defined in order to get "initialize" to work.

https://firebase.nuxtjs.org/guide/options/#initialize

So either setup these actions in your vuex store or set initialize to false in your nuxt-firebase config.

cliffordh commented 4 years ago

The documentation link provided doesn't say anything about vuex

lupas commented 4 years ago

The documentation link provided doesn't say anything about vuex

The documentation has been rebuilt last month so some stuff has been moved around, the correct link would be: https://firebase.nuxtjs.org/service-options/auth#initialize