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

163
Vistas
firebase issue with auth

I have an issue with firebase auth, it gives me this error:

TypeError: app.auth is not a function. (In 'app.auth()', 'app.auth' is undefined)

I write these lines of code:

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

const app = firebase.initializeApp({
    apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
    authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,
    projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,
    storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,
    messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,
    appId: process.env.REACT_APP_FIREBASE_APP_ID
})

export const auth = app.auth()
export default app

I tryed to replace with require the import of firebase/auth but it doesn't work, I tryed to uninstall and reinstall all node_modules but it didn't work, somebody can help me?

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

0

If you want to use the name-spaced syntax from V8 then use compat version of auth SDK as well:

import firebase from 'firebase/compat/app' 
import "firebase/compat/auth"
//                ^^^

I would recommend upgrading to the new Modular SDK for better performance and also the compat versions will be removed in upcoming updates.


import { initiliazeApp } from 'firebase/app' 
import { getAuth } from 'firebase/auth'

const app = initializeApp({...config})

export const auth = getAuth(app)
export default app
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