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

711
Views
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 answers
Answer question

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 Report

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 Report

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 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!