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

474
Views
Firebase : Uncaught Error: Component analytics has not been registered yet

I'm working on getting firebase working for a webapp project for class. It has not been easy. I keep getting errors, and every change I make creates a different error. Firebase is initialized in the project. Here is my most recent error:

>provider.ts:239 Uncaught Error: Component analytics has not been registered yet
>>at Provider.initialize (provider.ts:239),
>>at initializeAnalytics (api.ts:108),
>>at firebase-config.js:23,
>>>initialize @ provider.ts:239,
>>>initializeAnalytics @ api.ts:108,
>>>(anonymous) @ firebase-config.js:23

This error seems to be stemming from my firebase-config file, but I'm genuinely lost:

   // Import the functions you need from the SDKs you need
        //import * as firebase from 'firebase/app'; 
        import { initializeApp } from '../node_modules/firebase/firebase-app.js';
        import { initializeAnalytics , getAnalytics } from '../node_modules/firebase/firebase-analytics.js';
        
        
        const firebaseConfig = {
          [config keys]
        };
        
        // Initialize Firebase
        const fb_app = initializeApp(firebaseConfig); // returns an app 
        initializeAnalytics(fb_app); // added to circumvent error, but it still appears.
        const analytics = getAnalytics(fb_app);
        
        console.log(analytics); 
        export {fb_app};

Any help would be appreciated. Thanks

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

0

If you are using v9 SDK, your import statements must be

import { initializeApp } from 'firebase/app';
import { initializeAnalytics , getAnalytics } from 'firebase/analytics';

Not the files directly. There is a relevant discussion here: https://issueexplorer.com/issue/firebase/firebase-js-sdk/5597

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!