Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

473
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda