最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Writing to Firestore Database Results in Firestore net::ERR_BLOCKED_BY_CLIENT Error - Stack Overflow

programmeradmin1浏览0评论

I am trying to write to my firestore database and I get a net::ERR_BLOCKED_BY_CLIENT. I have a user save info from a form and writing it to a database.

Here is the request:

// react app

  const referenceDescriptionTextArea = useRef();
  const proposalsCollectionReference = collection(db, "proposals");

  const handleProposalSubmit = async (event) => {
    event.preventDefault();

    var data = {
      author: getCurrentUser().uid,
      timestamp: Timestamp.now(),
      tokenid: tokenid,
      type: "bio",
      description: referenceDescriptionTextArea.current.value,
    };

    addDoc(proposalsCollectionReference, data).then(
      (docRef) => {
        console.log(docRef.id); //saf89hnasHJADH9
        closeModal();
      },
      (err) => {
        console.log(err);
      }
    );
  };

Console Error after trying to submit a proposal:

channelrequest.js:1086          POST .firestore.v1.Firestore/Write/channel?VER=8&database=projects%2FREDACTED%2Fdatabases%2F(default)&gsessionid=sdaf7uOt-NfCFKX32b-Mw3sJBli_ssdsdfkaNw&SID=Q-mrJ98YFSsadflZRPA&RID=20557&TYPE=terminate&zx=pyjwqxvmw7j9 net::ERR_BLOCKED_BY_CLIENT

Some things I have tried are the following :

  1. Double checked the firestore rules to make sure it is value. In this case I only want authenticated users to write to the doc like so. Error persists.
    match /proposals/{proposal} {
        allow read, write: if request.auth != null;
    }
  1. I was convinced this was a firestore rule so I changed the firestore rule to allow anyone to write to it (on my local deployment). Error persists.
    match /proposals/{proposal} {
        allow read, write: if true; // on local deployment but not working
    }
  1. Some users state this error is due to Adblockers. To check against this I opened up a new instance of Chrome without extensions but I get the same results. I tried other browsers and ran into similar issues. Error persists.

I am trying to write to my firestore database and I get a net::ERR_BLOCKED_BY_CLIENT. I have a user save info from a form and writing it to a database.

Here is the request:

// react app

  const referenceDescriptionTextArea = useRef();
  const proposalsCollectionReference = collection(db, "proposals");

  const handleProposalSubmit = async (event) => {
    event.preventDefault();

    var data = {
      author: getCurrentUser().uid,
      timestamp: Timestamp.now(),
      tokenid: tokenid,
      type: "bio",
      description: referenceDescriptionTextArea.current.value,
    };

    addDoc(proposalsCollectionReference, data).then(
      (docRef) => {
        console.log(docRef.id); //saf89hnasHJADH9
        closeModal();
      },
      (err) => {
        console.log(err);
      }
    );
  };

Console Error after trying to submit a proposal:

channelrequest.js:1086          POST https://firestore.googleapis./google.firestore.v1.Firestore/Write/channel?VER=8&database=projects%2FREDACTED%2Fdatabases%2F(default)&gsessionid=sdaf7uOt-NfCFKX32b-Mw3sJBli_ssdsdfkaNw&SID=Q-mrJ98YFSsadflZRPA&RID=20557&TYPE=terminate&zx=pyjwqxvmw7j9 net::ERR_BLOCKED_BY_CLIENT

Some things I have tried are the following :

  1. Double checked the firestore rules to make sure it is value. In this case I only want authenticated users to write to the doc like so. Error persists.
    match /proposals/{proposal} {
        allow read, write: if request.auth != null;
    }
  1. I was convinced this was a firestore rule so I changed the firestore rule to allow anyone to write to it (on my local deployment). Error persists.
    match /proposals/{proposal} {
        allow read, write: if true; // on local deployment but not working
    }
  1. Some users state this error is due to Adblockers. To check against this I opened up a new instance of Chrome without extensions but I get the same results. I tried other browsers and ran into similar issues. Error persists.
Share Improve this question asked Oct 2, 2022 at 1:03 PotionPotion 9463 gold badges20 silver badges46 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

I found out it was Brave Shield on Brave. I did more research and heres what I gathered.

  • Edge, Chrome and Firefox: By default I use chrome. It is typical for other browsers like Edge and Firefox to prompt and auto import your settings (this includes bookmarks and extensions and only done once after install). Remove extensions like uBlockOrigin or HTTPS Everywehere. Once they were uninstalled I was able to make a request without an error

  • Brave Browser: By default it will have an adblocker called BraveShield. At the top right corner, click on the icon>Disable. The Error should now go away.

发布评论

评论列表(0)

  1. 暂无评论