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

247
Views
Firebase Firestore Bundle problem: db.loadBundle is not a function

Trying to configure bundles as per Google's docs. Specific error is:

TypeError: firebase_config__WEBPACK_IMPORTED_MODULE_2_.db.loadBundle is not a function

Here's my firebase.config.js:

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

And my app.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' });

    ...

Please note that my old fetchReadings worked, which had this instead:

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

What have I missed here? TIA.

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

0

The loadBundle() is a top level function in the new Modular SDK.

import { loadBundle } from "firebase/firestore"

await loadBundle(db, resp.body)

The same goes for namedQuery. Checkout the linked documentation for reference.

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!