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

219
Vistas
TypeError: Cannot read property 'auth' of undefined when calling " firebase.auth().onAuthStateChanged((user)"

i am new to using react native and firebase, I have this error: "TypeError: Cannot read property 'auth' of undefined"

I proceed to attach my code in an image:

enter image description here

I also proceed to copy and paste dependencies:

    "dependencies": {

"@react-native-community/masked-view": "0.1.10",

"@react-navigation/bottom-tabs": "~5.2.6",

"@react-navigation/native": "~5.1.5",

"@react-navigation/stack": "~5.2.10",

"expo": "~42.0.1",

"expo-status-bar": "~1.0.4",

"firebase": "^9.1.2",

"react": "16.13.1",

"react-dom": "16.13.1",

"react-native": "https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz",

"react-native-elements": "^3.4.2",

"react-native-gesture-handler": "~1.10.2",

"react-native-reanimated": "~2.2.0",

"react-native-router-flux": "3.36.0",

"react-native-safe-area-context": "^3.3.2",

"react-native-screens": "~3.4.0",

"react-native-vector-icons": "^8.1.0",

"react-native-web": "~0.13.12"

},

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You are using Firebase Modular SDK which has a completely new syntax and you also need to import Firebase Auth. To keep using existing code you can try changing the imports to these:

import firebase from 'firebaser/compat/app'
import 'firebase/compat/auth'

I'll recommend upgrading to Modular SDK for it's benefits and the compat version will be removed soon.

about 4 years ago · Juan Pablo Isaza Denunciar
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