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

243
Views
Problema de Firebase Firestore Bundle: db.loadBundle no es una función

Intentando configurar paquetes según los documentos de Google . El error específico es:

TypeError: firebase_config__WEBPACK_IMPORTED_MODULE_2 _.db.loadBundle no es una función

Aquí está mi firebase.config.js:

 import { initializeApp } from "firebase/app"; import { getFirestore } from "firebase/firestore"; var firebaseConfig = {...}; const app = initializeApp(firebaseConfig); export const db = getFirestore(app);

Y mi aplicación.js:

 import React, { useState, useEffect } from 'react'; import { query, orderBy, limit, collection, getDocs, loadBundle } from "firebase/firestore"; import { db } from './firebase.config.js'; import './App.css'; function App() { ... const fetchReadings = async () => { const readingsArray = []; const dailyAveragesArray = []; const resp = await fetch('/createBundle'); console.log("resp: ",resp); await db.loadBundle(resp.body); const query = await db.namedQuery('all-readings-query'); const readingSnapshot = await query.get({ source: 'cache' }); ...

Tenga en cuenta que mi antiguo fetchReadings funcionó, que tenía esto en su lugar:

 const readingQuery = query(collection(db, "readings")); const readingSnapshot = await getDocs(readingQuery);

¿Qué me he perdido aquí? TIA.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

loadBundle() es una función de nivel superior en el nuevo Modular SDK.

 import { loadBundle } from "firebase/firestore" await loadBundle(db, resp.body)

Lo mismo ocurre con namedQuery . Consulte la documentación vinculada como referencia.

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!