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

349
Visualizações
Why getting Uncaught TypeError: Failed to resolve module specifier "firebase". Relative references must start with either "/", "./", or "../"?

I have shifted my code from v8 to v9 version with modular code,but I am getting this error inspite of having installed the rollup package. My JS Code:

<script type="module">
      // TODO: Add SDKs for Firebase products that you want to use
      // https://firebase.google.com/docs/web/setup#available-libraries
      import firebase from 'firebase';
      import { initializeApp } from "firebase/app"
      import { getAuth, onAuthStateChanged } from "firebase/auth";
      import { getDatabase } from "firebase/database"
      // Your web app's Firebase configuration
      const firebaseConfig = {
      //app config
      };

      // Initialize Firebase
      const firebaseApp = initializeApp(firebaseConfig);
      const db = getDatabase(firebaseApp);
      const auth = getAuth(firebaseApp);
    </script>

The error I am getting: Uncaught TypeError: Failed to resolve module specifier "firebase". Relative references must start with either "/", "./", or "../"

I have spent considerable time but unable to find the issue.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

As far as I understand a big part of firebase 9 is that you no longer need to import the entire firebase, and can now just import whatever modules you need.

You therefore do not need to

import firebase from 'firebase';

Try not importing "firebase" and see what happens

about 4 years ago · Juan Pablo Isaza Relatório

0

I also had a similar error. I solved this error like this.

import { initializeApp } from 'https://www.gstatic.com/firebasejs/9.6.3/firebase-app.js'
import { getAuth } from 'https://www.gstatic.com/firebasejs/9.6.3/firebase-auth.js'

I think you can use those URL.

I am not sure this is the proper way.

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