On a newly created project, I cannot publish any changes to the Firebase rules. Even simple changes like adding a newline to the end of the file or adding a space.

I feel like this may be a bug in Firestore but thought I'd ask here first...
Error saving rules –An unknown error occurred
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if false;
}
}
}
I found that the Allow CORS: Access-Control-Allow-origin Chrome extension was the cause of this error for me. Disabling the extension fixed the error.
Install Firebase CLI in your command prompt, login in the firebase CLI, then open the .rules file with your editor(vscode, atom) and replace it with :
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true;
}
}
}
then deploy to firebase with from your command prompt with this command
firebase deploy --only firestore:rules
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With