firestore on nodejs server is very slow


I’m using Firestore with Nodejs (expressjs framework) and the first simple request takes more than 25 seconds!

and if i get the same request with JavaScript in the client-side or with Rest API tool like (postman) i get the data immediately! no problem!
So what is the issue here?

this is the code:

var express = require('express');
var router = express.Router();

const admin = require("firebase-admin");

const serviceAccount = require("../privte/quiztestweb-firebase-adminsdk-vd7zn-1a3a896f60.json");

  credential: admin.credential.cert(serviceAccount),
  databaseURL: ""

/* GET users listing. */
router.get('/', function (req, res, next) {

  let db = admin.firestore();

    .then((snapshot) => {
      snapshot.forEach((doc) => {
        console.log(, '=>',;
    .catch((err) => {
      console.log('Error getting documents', err);

  res.send('respond with a resource');

module.exports = router;



i solve this issue by removing the new version of firebase package and replace it with an older one!

((but it’s still just a temporary solution .. until fixed by firebase

Answered By – zakaria chahboun

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published