Pot*_*ion 2 javascript reactjs google-cloud-firestore
我正在尝试写入我的 firestore 数据库,但收到 net::ERR_BLOCKED_BY_CLIENT。我有一个用户保存表单中的信息并将其写入数据库。
这是请求:
// 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);
}
);
};
Run Code Online (Sandbox Code Playgroud)
尝试提交提案后控制台错误:
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
Run Code Online (Sandbox Code Playgroud)
我尝试过的一些事情如下:
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
Run Code Online (Sandbox Code Playgroud)
match /proposals/{proposal} {
allow read, write: if request.auth != null;
}
Run Code Online (Sandbox Code Playgroud)
我发现这是《勇敢传说》中的《勇敢盾》。我做了更多研究,这就是我收集到的内容。
Edge、Chrome 和 Firefox:默认情况下我使用 Chrome。Edge 和 Firefox 等其他浏览器通常会提示并自动导入您的设置(这包括书签和扩展程序,并且仅在安装后完成一次)。删除 uBlockOrigin 或 HTTPS Everywehere 等扩展。一旦它们被卸载,我就可以毫无错误地发出请求
Brave 浏览器:默认情况下,它将有一个名为 BraveShield 的广告拦截器。单击右上角的图标>禁用。错误现在应该消失了。
| 归档时间: |
|
| 查看次数: |
2643 次 |
| 最近记录: |