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.com/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 :
match /proposals/{proposal} {
allow read, write: if request.auth != null;
}
match /proposals/{proposal} {
allow read, write: if true; // on local deployment but not working
}
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.