Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

161
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!