TZM
TZM

Reputation: 11

How to fix "Unhandled Rejection (Error): not supported" error in React+Cloud Firestore

I am trying to query a Cloud Firestore database with the following query:

db.collection("shops").where("email", "==", user.email).get()
.then(...)
.catch(...)

I have written code in the "catch" block in order to handle a promise rejection, but I am getting the following error by invoking ".get()"

Unhandled Rejection (Error): not supported

I have looked up this error online and there does not seem to be anybody asking about this kind of error. Does anybody have an idea as to what could be causing this? I have done all of my firebase/firestore queries according to official documentation. Thanks!

Upvotes: 1

Views: 682

Answers (2)

Daniel Danielecki
Daniel Danielecki

Reputation: 10512

Please follow #1445, in my case I had to do the following:

  1. Open node_modules/protobufjs/src/util/minimal.js.
  2. Change the following line util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node); to util.isNode = true;.

Upvotes: 1

Peter R Mast
Peter R Mast

Reputation: 11

Which Firebase SDK are you using? I was getting the same error on a Node application using Firebase-Admin, but because I was using domino to create a Window object it would fail since it was checking to see if it was running in on Node by checking if global.window.

Upvotes: 1

Related Questions