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

284
Visualizações
Property 'auth' does not exist on type 'FirebaseApp' on REACT

I'm learning how to use firebase authentication in a react app and i have met this issue. Can somebody help me ?

i have installed firebase with npm. This is my firebase.js file.

import { initializeApp } from "firebase/app";
import 'firebase/auth'

const firebaseConfig = {
apiKey: "AIzaSyA_89k1bt6Z2_1lVLb_Vwn5OL9_GgTNQEQ",
authDomain: "auth-development-59396.firebaseapp.com",
projectId: "auth-development-59396",
storageBucket: "auth-development-59396.appspot.com",
messagingSenderId: "1003786595756",
appId: "1:1003786595756:web:fa93ae00e49a4c04c49e09"

};

const app = initializeApp(firebaseConfig);

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

This is the dependencies package.json file.

"dependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"bootstrap": "^5.1.1",
"firebase": "^9.0.2",
"react": "^17.0.2",
"react-bootstrap": "^1.6.3",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"web-vitals": "^1.1.2"
 }
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You are using the new Modular SDK which uses a different syntax than the name-spaced (v8) version. Try this:

import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth" // New import

const app = initializeApp(firebaseConfig);

export const auth = getAuth(app)
export default app

Do note that if you must refactor all your code to work with the new syntax. I'd recommend checking out the documentation to learn more about the new syntax. Also checkout this Firecast.


If you wish to use the V8 name-spaced syntax, then you can use the compat versions:

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

if (!firebase.apps.length) firebase.initializeApp({...config})

export const auth = firebase.auth()
export default app
about 4 years ago · Juan Pablo Isaza Relatório
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