Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

354
Vistas
updateDoc: Uncaught FirebaseError: Invalid document reference

When updating a document in v9 of firebase/firestore I got an error and I've been following the official documentation and not sure what I'm doing wrong:

import { initializeApp } from "firebase/app";
import { getFirestore, updateDoc, doc} from 'firebase/firestore';
import firebaseConfig from '../utils/firestore';

const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

function updateSeries(docID, name, desc) {

    const data = {
        name: name,
        desc: desc,
        lastUpdatedAt: Timestamp.now(),
    }

    const seriesDocRef = doc(db, "MY_COL", docID)


    return new Promise((resolve, reject) => {
        updateDoc(seriesDocRef, data).then(() => {
            resolve();
        }).catch((e) => {
            reject(e);
        })
    })
}

When I call this function I get this error:

errors.ts:94 Uncaught FirebaseError: Invalid document reference. Document references must have an even number of segments, but MY_COL has 1.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If the values in passed into the doc function are undefined or falsy it can cause this error. Please check if the db and docID variables are defined in:

const seriesDocRef = doc(db, "MY_COL", docID)
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda