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

344
Views
Nuxt Firebase don't return the collection array

I've made a plugin , where i need to call my firebase database to loop all collections. But after setup , the function return me a object with firestore details , but no data. In page and component I use firestore() function to get the collections.

This is my plugin/getRoutes.js

const {db} =  require('@/plugins/firebase')
var self = {
    firestore: async function() {    
        const list = db.collection('wpProducts');
        console.log("list", list);
        return  list 
    }
        
  };

module.exports = self.firestore;

This return me in console.log this Object

    DocumentReference$1 {
  firestore: Firestore {
    _delegate: FirebaseFirestore$1 {
      type: 'firestore',
      _persistenceKey: '[DEFAULT]',
      _settings: [FirestoreSettings],
      _settingsFrozen: true,
      _app: [FirebaseAppImpl],
      _databaseId: [DatabaseId],
      _credentials: [FirebaseCredentialsProvider],
      _queue: [AsyncQueueImpl],
      _firestoreClient: [FirestoreClient]
    },
    _persistenceProvider: IndexedDbPersistenceProvider {},
    INTERNAL: { delete: [Function: delete] },
    _appCompat: FirebaseAppImpl {
      firebase_: [Object],
      isDeleted_: false,
      name_: '[DEFAULT]',
      automaticDataCollectionEnabled_: false,
      options_: [Object],
      container: [ComponentContainer]
    }
  },
  _delegate: DocumentReference {
    converter: null,
    _key: DocumentKey { path: [ResourcePath] },
    type: 'document',
    firestore: FirebaseFirestore$1 {
      type: 'firestore',
      _persistenceKey: '[DEFAULT]',
      _settings: [FirestoreSettings],
      _settingsFrozen: true,
      _app: [FirebaseAppImpl],
      _databaseId: [DatabaseId],
      _credentials: [FirebaseCredentialsProvider],
      _queue: [AsyncQueueImpl],
      _firestoreClient: [FirestoreClient]
    }
  },
  _userDataWriter: UserDataWriter {
    firestore: Firestore {
      _delegate: [FirebaseFirestore$1],
      _persistenceProvider: IndexedDbPersistenceProvider {},
      INTERNAL: [Object],
      _appCompat: [FirebaseAppImpl]
    }
  }
}

In the pages I use this function to get the data, and it work without problem.

import { db } from '~/plugins/firebase'
.....
  firestore() {
    return { 
      products: db.collection('wpProducts')`
    }
}

How i can get the same array of result ? i tryed to made some changes, but I will have the same result.

about 4 years ago · Juan Pablo Isaza
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!