Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

363
Visualizações
Uncaught (in promise) TypeError: Object(...)(...).once is not a function

Hi I need some help with these it says that

Uncaught (in promise) TypeError: Object(...)(...).once is not a function at eval (store.js?07a4:42:1) at eval (index-6de4cbb9.js?4d2d:2453:1)

Here's my code:

import { firebaseAuth, firebaseDb } from 'boot/firebase'
import { createUserWithEmailAndPassword, signInWithEmailAndPassword,onAuthStateChanged } from "firebase/auth";
import { ref, set } from "firebase/database";


const state = {

}
const mutations = {

}
const actions = {
  registerUser({}, payload) {
     createUserWithEmailAndPassword(firebaseAuth, payload.email, payload.password)
     .then(response => {
         console.log(response)
         const userId = firebaseAuth.currentUser.uid
          set(ref(firebaseDb, 'users/' + userId), {
            name: payload.name,
            email: payload.email,
            online: true
          })
     }).catch(error => {
       console.log(error.message)
     })
  },
  loginUser({}, payload) {
    signInWithEmailAndPassword(firebaseAuth, payload.email, payload.password)
     .then(response => {
         console.log(response)
     }).catch(error => {
       console.log(error.message)
     })
  },

Here's the part that is error:

  handleAuthStateChanged() {
    onAuthStateChanged(firebaseAuth, user => {
      if (user) {
        // User is signed in, see docs for a list of available properties
        // https://firebase.google.com/docs/reference/js/firebase.User
        const userId = firebaseAuth.currentUser.uid
        ref(firebaseDb, 'users/' + userId).once('value', snapshot => {
          console.log('snapshot: ', snapshot)
        })
        // ...
      } else {

User is signed out

// ...
      }
    })
  }
}
const getters = {

}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}

i dont get it i still received this kind of error

<script>
  import { mapActions } from "vuex"

  export default {
    methods: {
      ...mapActions('store', ['handleAuthStateChanged'])
    },
    mounted(){
      this.handleAuthStateChanged()
    }
  }
</script>

this is my App.vue script

error

full-code

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda