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

348
Views
Uncaught FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app). HTML and Javascript

I have seen many websites (which includes StackOverflow) about the same error with their solutions but none of them have worked for me.

I know that the error means that I've run a function using firebase before it was initialized.

Here are the relevant parts of my code:

        window.addPerson = addPerson;

        const queryString = window.location.search;
        const urlParams = new URLSearchParams(queryString);
        const userVar = urlParams.get('user')

        const userVarSplitted = userVar.split('#')
        const userVarFormatted = userVarSplitted[0] + ":" + userVarSplitted[1]

        // Import the functions you need from the SDKs you need
        import { initializeApp } from "https://www.gstatic.com/firebasejs/9.6.4/firebase-app.js";
        import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.6.4/firebase-analytics.js";
        import { getDatabase, ref, set } from "https://www.gstatic.com/firebasejs/9.1.0/firebase-database.js";
        // TODO: Add SDKs for Firebase products that you want to use
        // https://firebase.google.com/docs/web/setup#available-libraries

        // Your web app's Firebase configuration
        // For Firebase JS SDK v7.20.0 and later, measurementId is optional
        const firebaseConfig = {
            apiKey: "AIzaSyC6KGzXriv7IoQzcayPlzi-Xt_eRLgOqko",
            authDomain: "jerrybot-fa77f.firebaseapp.com",
            databaseURL: "https://jerrybot-fa77f-default-rtdb.europe-west1.firebasedatabase.app",
            projectId: "jerrybot-fa77f",
            storageBucket: "jerrybot-fa77f.appspot.com",
            messagingSenderId: "374262858544",
            appId: "1:374262858544:web:7971e56f62fab12631fef5",
            measurementId: "G-JQTEB5NDRE"
        };

        // Initialize Firebase
        const app = initializeApp(firebaseConfig);
        if (app.length === 0) {
            console.log("no firebas app")
        }else{
            console.log("initialized")
        }
        const analytics = getAnalytics(app);
        const db = getDatabase();

        function addPerson() {
            set(ref(db, "verified/" + userVarFormatted), {
                name: userVarSplitted[0],
                discriminator: userVarSplitted[1]
            });

            console.log("added")
        }

It does say Initialized in the console meaning the app exists. Do you know what's happening?

PS: The javascript type is set to module

Do you know what's happening? Thanks

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!