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

374
Views
onValue() somehow causing ERROR Error: Uncaught (in promise): RangeError: Maximum call stack size exceeded

I'm trying to use the plain vanilla Firebase SDK for the realtime database, and this mysterious error keeps on appearing at seemingly random read / write actions. I can't detect any recursive functions that would cause it. Any insight into what this might relate to is much appreciated.

ERROR Error: Uncaught (in promise): RangeError: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at ChildrenNode.isLeafNode (index.esm2017.js:5403)
    at ChildrenNode.equals (index.esm2017.js:5677)
    at ChildrenNode.equals (index.esm2017.js:5682)
    at ChildrenNode.equals (index.esm2017.js:5682)
    at ChildrenNode.equals (index.esm2017.js:5682)
    at ChildrenNode.equals (index.esm2017.js:5682)
    at ChildrenNode.equals (index.esm2017.js:5682)
    at ChildrenNode.equals (index.esm2017.js:5682)
    at ChildrenNode.equals (index.esm2017.js:5682)
    at ChildrenNode.equals (index.esm2017.js:5682)
    at resolvePromise (zone.js:1213)
    at zone.js:1120
    at asyncGeneratorStep (asyncToGenerator.js:6)
    at _throw (asyncToGenerator.js:29)
    at ZoneDelegate.invoke (zone.js:372)
    at Object.onInvoke (core.js:28673)
    at ZoneDelegate.invoke (zone.js:371)
    at Zone.run (zone.js:134)
    at zone.js:1276
    at ZoneDelegate.invokeTask (zone.js:406)

One thing I do know is that when I don't use onValue, I don't get the error. Here is how I'm trying to convert the callback into an observable:

listenToOne(proposalId: string): Observable<SuccessOrFail<Proposal>> {
        let unsub: Unsubscribe;
        const subject = new BehaviorSubject<SuccessOrFail<Proposal>>(Result.fail(`Not Yet`));
        get(this.getProposalRef(proposalId)).then(snapshot => {
            const proposalRef = ref(this.db, `proposals/${Object.keys(snapshot.val())[0]}`);
            unsub = onValue(proposalRef, snapshot => {
                const spec: ProposalBuildSpec = snapshot.val();
                subject.next(Result.success(this.proposalMapper.toDomain(spec)));
            });
        });
        return subject.pipe(finalize(() => unsub()));
    }

I've tried tons of variations but nothing has worked. I see there are many questions posted about the RangeError: Maximum call stack size exceeded, but nothing relating to these mysterious ChildrenNode.equals.

Any help is much appreciated! Thanks!

enter image description here

about 4 years ago · Santiago Trujillo
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!