The ISR pages I have in my web application does not seem to be rendering because it says firebase permissions are insufficient however when I test those permissions, it works absolutely fine. I do not know what the issue is here.
Here are my firestore rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /blogs/{blog} {
allow read, get;
allow write, update, create, delete: if (request.auth.uid == "R3tc0RKCDgX8yhaHS5c0Ej3IXxF3");
}
match /forum/{forum} {
allow read, get;
allow write, create, update, delete: if (request.auth.uid == "R3tc0RKCDgX8yhaHS5c0Ej3IXxF3");
}
match /forum/{forum}/messages/{messages} {
allow read, get;
allow write, create, update, delete: if (request.auth.uid != null);
}
match /chats/{room} {
allow write, read, get, create, update, delete: if request.auth.uid == get(/databases/$(database)/documents/chats/$(room)).data.uid[0] || request.auth.uid == get(/databases/$(database)/documents/chats/$(room)).data.uid[1];
}
match /chats/{room}/messages/{messages} {
allow write, read, get, create, update, delete: if request.auth.uid == get(/databases/$(database)/documents/chats/$(room)).data.uid[0] || request.auth.uid == get(/databases/$(database)/documents/chats/$(room)).data.uid[1];
}
}
}
and here is the getStaticPaths
function for one of my ISR pages
export async function getStaticPaths() {
let array = [];
await getDocs(collection(firestore, "forum")).then((res) => {
array = res.docs.map((data) => {
const { id } = data.data();
return {
params: { question: id },
};
});
});
return {
paths: array,
fallback: "blocking",
};
}
The firebase rules playground works absolutely fine and data is also fetched fine when done with Server Side Rendering but it fails when it comes to Incremental Static Regeneration of NEXT JS. Your help is highly appreciated.