Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

472
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda