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

172
Views
TypeError: firebaseApp.auth is not a function

I am using firebase authentication in my react application for sign-in users but I am getting error:-TypeError: firebaseApp.auth is not a function. My Firebase. file is:-

import * as firebase from "firebase/app"
import "firebase/auth"

const firebaseApp=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=firebaseApp.auth()
export default firebaseApp

Please help me with that

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You probably have the SDK version 9 installed but use SDK version 8 syntax.

You have 2 options. Addopt the new SDK to use the old syntax with importing your firebase like this:

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

const firebaseApp=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=firebaseApp.auth()
export default firebaseApp

or

use the new syntax:

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

const firebaseConfig = {
  //...
};

const app = initializeApp(firebaseConfig);
const auth = getAuth();
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!