Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

190
Vistas
Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'onSnapshot') version 9

In my App.js

componentDidMount() {
this.authListerner = auth.onAuthStateChanged(async userAuth => {
 if (userAuth){
   const userRef = await handleUserProfile(userAuth);
    userRef.onSnapshot(snapshot => {
     this.setState({
       currentUser: {
         id: snapshot.id,
         ...snapshot.data(),
       }
     })
   })
 }
  
 this.setState({
   ...initialState
 });
});
}

My utilis.js

export const handleUserProfile = async ({userAuth, additionalData = {}})
=> {
if (!userAuth) {
console.warn("No userAuth provided!");
return;
}
const { uid } = userAuth;
const userRef = doc(collection(firestore, `users/${uid}`));
const snapshot = await userRef.get();
if (!snapshot.exists) {
const { displayName, email } = userAuth;
const timestamp = new Date();
try {
  await userRef.setDoc(firestore, {
    displayName,
    email,
    createdDate: timestamp,
    ...additionalData,
  })
} catch(err) {
  console.warn(err);
}
}
return userRef;
};

the problem I facing

Can anyone help me with this. I cant get it to run. I am using firebase web version 9. which I trying to use a simple from version 8

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda