Jump to content

After digging around for the last few days, I have concluded that I'm not able to find an answer to my topic that works. I'm making a Nuxt SSR (Server Side Rendering) application that is using firebase as the primary source of authentication and using firebase firestore for the database.

When I get my user from the token from firebase, I dispatch the action from the user store.

 

GET_ACCOUNT_DETAILS - STORE ACTION

async GET_ACCOUNT_DETAILS({ commit }, uid) {
    console.log('[USER_STORE][ACTION]: GET_ACCOUNT_DETAILS', uid)
    await firebase
      .firestore()
      .collection('users')
      .doc(uid)
      .get()
      .then(doc => {
        if (doc.exists) {
          console.log('[USER_STORE][ACTION][GET_ACCOUNT_DETAILS]:', doc.data())
          commit('SET_ACCOUNT_DETAILS', doc.data())
        }
      })
  },

When I get to running this Action, stopped by

Quote

Function CollectionReference.doc() requires its first argument to be of type non-empty string, but it was: ""

Even when I check the typeof the uid that got passed in, it is still a string and given with a value. The console.log above the firebase statement shows that in the log.

I wish I knew how to stop breaking computers...

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×