Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/432.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 获得';拒绝许可';在React web app中集成firebase时_Javascript_Reactjs_Firebase_Google Cloud Firestore - Fatal编程技术网

Javascript 获得';拒绝许可';在React web app中集成firebase时

Javascript 获得';拒绝许可';在React web app中集成firebase时,javascript,reactjs,firebase,google-cloud-firestore,Javascript,Reactjs,Firebase,Google Cloud Firestore,我试图通过react web app保存文档,但面临以下问题。我已经阅读了firebase规则文档 这是密码 constructor(props) { super(props); var config = { apiKey: "<apiKey>", authDomain: "<authDomain>", databaseURL: "<databaseURL>", projectId: "<

我试图通过react web app保存文档,但面临以下问题。我已经阅读了firebase规则文档

这是密码

constructor(props)
  {
    super(props);
    var config = {
      apiKey: "<apiKey>",
      authDomain: "<authDomain>",
      databaseURL: "<databaseURL>",
      projectId: "<projectId>",
      storageBucket: "",
      messagingSenderId: "<messagingSenderId>"
    };
    firebase.initializeApp(config);
  }
数据库规则:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write:if true;
    }
  }
}
Uncaught (in promise) Error: PERMISSION_DENIED: Permission denied
    at index.cjs.js:13076
    at exceptionGuard (index.cjs.js:690)
    at Repo../node_modules/@firebase/database/dist/index.cjs.js.Repo.callOnCompleteCallback (index.cjs.js:13067)
    at index.cjs.js:12844
    at index.cjs.js:12019
    at PersistentConnection../node_modules/@firebase/database/dist/index.cjs.js.PersistentConnection.onDataMessage_ (index.cjs.js:12052)
    at Connection../node_modules/@firebase/database/dist/index.cjs.js.Connection.onDataMessage_ (index.cjs.js:11337)
    at Connection../node_modules/@firebase/database/dist/index.cjs.js.Connection.onPrimaryMessageReceived_ (index.cjs.js:11331)
    at WebSocketConnection.onMessage (index.cjs.js:11232)
    at WebSocketConnection../node_modules/@firebase/database/dist/index.cjs.js.WebSocketConnection.appendFrame_ (index.cjs.js:10837)
    at WebSocketConnection../node_modules/@firebase/database/dist/index.cjs.js.WebSocketConnection.handleIncomingFrame (index.cjs.js:10887)
    at WebSocket.mySock.onmessage (index.cjs.js:10784)
我们面临着这个问题。我做错了什么

堆栈跟踪:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write:if true;
    }
  }
}
Uncaught (in promise) Error: PERMISSION_DENIED: Permission denied
    at index.cjs.js:13076
    at exceptionGuard (index.cjs.js:690)
    at Repo../node_modules/@firebase/database/dist/index.cjs.js.Repo.callOnCompleteCallback (index.cjs.js:13067)
    at index.cjs.js:12844
    at index.cjs.js:12019
    at PersistentConnection../node_modules/@firebase/database/dist/index.cjs.js.PersistentConnection.onDataMessage_ (index.cjs.js:12052)
    at Connection../node_modules/@firebase/database/dist/index.cjs.js.Connection.onDataMessage_ (index.cjs.js:11337)
    at Connection../node_modules/@firebase/database/dist/index.cjs.js.Connection.onPrimaryMessageReceived_ (index.cjs.js:11331)
    at WebSocketConnection.onMessage (index.cjs.js:11232)
    at WebSocketConnection../node_modules/@firebase/database/dist/index.cjs.js.WebSocketConnection.appendFrame_ (index.cjs.js:10837)
    at WebSocketConnection../node_modules/@firebase/database/dist/index.cjs.js.WebSocketConnection.handleIncomingFrame (index.cjs.js:10887)
    at WebSocket.mySock.onmessage (index.cjs.js:10784)

新手犯的错误是,使用了更新的firestore数据库而不是实时数据库。更改为实时数据库修复了该问题

你能详细说明一下吗。我想我也有同样的问题你明白你的意思。但是你知道为什么不使用高级版本吗??为什么不更新firestore数据库?在数据库页面上,会有一个下拉列表,上面写着“CloudFireStorm BETA”。点击它并将其更改为“实时数据库”。