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

719
Vistas
service firestore is not available

I'm trying to connect to my firestore using plain javascript. (I wanna get up to speed and running for now)

index.js:

import app from './firebase.js'
import { getFirestore } from 'https://www.gstatic.com/firebasejs/9.0.0/firebase-firestore.js'
const db = getFirestore(app)

However, this throws an error: Uncaught Error: Service firestore is not available

firebase.js:

import { initializeApp } from "https://www.gstatic.com/firebasejs/9.0.1/firebase-app.js";
 
  const firebaseConfig = {
    // configs
  };

  // Initialize Firebase
  let app
  export default app = initializeApp(firebaseConfig);

Then I import the script in my index.html:

<!DOCTYPE html>
....
<script type="module" src="index.html"></script>

Note: I can read and write to the firestore using firebase web interface.

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

So if you want to use plain js (without bundlers like webpack), you would need to put your JS code into script tag like so:

<script type="module">
  import { initializeApp } from "https://www.gstatic.com/firebasejs/9.0.1/firebase-app.js";
  
  const firebaseConfig = { ... };
  const app = initializeApp(firebaseConfig);
</script>

Otherwise, if you want to use it like you intended to do so, you would need to:

  • install a firebase package
  • a module bundler (e.g. webpack) to bundle the files for you
about 4 years ago · Juan Pablo Isaza Denunciar

0

Using npm, but got the same error message. Restarted terminal & uninstalled and reinstall firebase, then worked...not sure which one that did it though.

about 4 years ago · Juan Pablo Isaza Denunciar

0

You need to upgrade your firestore version 9.0.0 to 9.4.0 and it work fine

import { getFirestore, collection, getDocs } from "https://www.gstatic.com/firebasejs/9.4.0/firebase-firestore.js";
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