Error: On any change of firestore.rules, Firestore emulator output:
i firestore: Change detected, updating rules...
**⚠ firestore.rules:0:0 - ERROR Rules content empty. Compilation aborted.**
✔ firestore: Rules updated.
Platforms tried: WSL as well as an Ubuntu VM under virtualbox
Codelab: https://google.dev/codelabs/firebase-emulator-test-rules
Current firestore.rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /carts/{cartID} {
allow create: if request.auth.uid == request.resource.data.ownerUID;
allow read, update, delete: if request.auth.uid == resource.data.ownerUID;
}
match /carts/{cartID}/items/{itemID} {
allow read, write: if get(/databases/$(database)/documents/carts/$(cartID)).data.ownerUID == request.auth.uid;
}
match /items/{itemID} {
allow read; // Users can read items
// In a production app, don't allow unconditional write access!
allow create; // For the codelab, client app uses this to add seed data.
}
}
}
Project Configuration on Firebase console: Only two modifications were made to the default project, enable anonymous auth (per codelab), and add firestore in production mode.
... I've googled for this "firestore.rules:0:0 - ERROR Rules content empty. Compilation aborted." error, but nothing comes up. Anybody else see this?
rules_version = '2';from the beginning? My theory is it's a bug that the emulator doesn't recognize that instruction. - samthecodingman