79174072

Date: 2024-11-10 03:09:27
Score: 1
Natty:
Report link

I'm using process.cwd() but I'm getting this error on vercel

Unhandled Rejection: Error: ENOENT: no such file or directory, open '/var/task/src/contents/projects/undefined.md'

and this on development

unhandledRejection: Error: ENOENT: no such file or directory, open 'C:\Users\User\Desktop\My-Portfolio\src\contents\projects\undefined.md' at Object.readFileSync (node:fs:448:20)

This is how I used it. My markdown files are in the path src/contents/projects/

const projectDirectory = path.join(process.cwd(), 'src', 'contents', 'projects')
Reasons:
  • RegEx Blacklisted phrase (1): I'm getting this error
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Idighs