i have a api route in my nextjs project and i'm using fs.writeFile method such as
await fs.writeFile( process.cwd() + '/app/data/list.json', data )
It is working properly on development and local production mode, but not working on the vercel build. It throws an error code: "ENOENT" errno: -2
meaning that file not found
What should i do to make it work properly on the vercel build, and why is that happening?
I tried __dirname instead of process.cwd() but not worked