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

213
Views
.initializeApp is not a function (firebase 9.6.7)

I am developing an app using Gatsby, React, and Firebase. The app works fine in the npm run develop stage of development, but when I attempt to build using npm run build, I get the error

WebpackError: TypeError: (0 , dist_namespaceObject.initializeApp) is not a function

import { initializeApp } from "firebase/app"
import { getFirestore, getDoc, doc} from "firebase/firestore";


import { navigate } from 'gatsby'


const firebaseConfig = {
   // Firebase config goes here
};


const app = initializeApp(firebaseConfig);
//const analytics = getAnalytics(app);
const db = getFirestore();

This is the relevant code I am using, and I cannot find any solution to this problem as of right now. I am using Firebase 9.6.7, Gatsby 4.8.0, React 17.0.2 and Node 17.31. I've tried all sorts of things, including changing the import, importing everything, but have had no luck so far.

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