I'm getting a weird error where a folder exists but fs.readdirSync is unable to read it. I have attached my folder structure and the call stack is as follows:
utils/posts.js (6:20) @ fs
4 |
5 | export function getAllPostIds() {
> 6 | const fileNames = fs.readdirSync(postsDirectory);
| ^
7 |
8 | // Returns an array that looks like this:
9 | // [
Callstack
getAllPostIds
app/posts/[id]/page.js (52:29)