Inside functions file can't be found error

Hi! I’m just using netlify functions and I made nuxt static site and

the root project directory has “functions”

so inside there,
i put function js file and csv file

but when I used __dirname +“/xxx.csv” to open that csv file in my function js file,
it used to work perfectly, but like from a month ago,
it doesn’t work!!!

error goes like:
: no such file or directory, open ‘/var/task/functions/myfunction_name_dir/

HI @sacredlight,

Thanks for reaching out and welcome to Netlify’s Support Forums!

Could you provide the sitename of the site where you’re having this issue? If you could share the, that’ll help us investigate this issue.

1 Like

thank you so much!
but I am a bit concerned about the security issue for that.

in my nuxt project directory there’s “functions” directory and inside I made “xxx” folder and then inside
I created a js xxx.js file and csv together in the same folder.

and in netlify config dashboard i specified functions folder as “functions”

and I used __dirname +“/yyy.csv” for reaching that csv file.

it actually worked so well but when I just deployed my same app it doesn’t work!

{“errorType”:“Error”,“errorMessage”:“ENOENT: no such file or directory, open ‘/var/task/functions/xxx/yyy.csv’”

Check out: How to Include Files in Netlify Serverless Functions