Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

124
Visualizações
Firestore recursiveDelete call stack exceeded

I am attempting to delete all subcollections of a firestore document in React Native, using the firebase cloud functions recursiveDelete() method. When the function is called, it fails with

[Unhandled promise rejection: RangeError: Maximum call stack size exceeded.]
at [native code]:null in map
at [native code]:null in map
.
.
.
at [native code]:null in map

There is very little documentation on this function, in fact, it is not even mentioned in the official firebase docs. It is only documented here https://googleapis.dev/nodejs/firestore/4.15.1/Firestore_.html#recursiveDelete. People from this discussion seemed to have success with this function.

I implemented my function following the documentation's instructions, so this error confuses me, especially since I was under the impression the entire point of this function was to avoid exceeding the maximum call stack size.

This is my cloud function that calls recursiveDelete():

exports.deleteSubs = functions.https.onCall(async(data, context)=>{
    await firestore.recursiveDelete(data.path)
})

and the front-end code which calls the cloud function

var functions = firebase.functions()
let deleteFn = functions.httpsCallable('deleteSubs');

let ref = db.collection("Posts").doc(post.key)
deleteFn({path: ref})

This error occurs with and without the optional bulkWriter included in the docs example.

It also fails on documents with no nested subcollections (which makes me confused on how the stack size is being exceeded).

I have verified that the path being passed in is correct.

about 4 years ago · Santiago Gelvez
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda