Closed ndozhh closed 1 year ago
Anyone had a chance to look at this? I'm facing the same issue on my application
could be related https://github.com/vercel/vercel/discussions/5066#discussioncomment-54268
in vercel.json
you might need to include the .node-persist
dir
this is NOT tested I do not have a vercel host
{
"functions": {
"app.js": { // <-- not sure about this value here
"includeFiles": "/var/task/.node-persist/**" // or "includeFiles": "/var/task/.node-persist/**"
}
}
}
I included the path for all my serverless functions but I'm still getting the same error. Any help is greatly appreciated.
Error message:
[Error: ENOENT: no such file or directory, mkdir '/var/task/.node-persist'] {
errno: -2,
code: 'ENOENT',
syscall: 'mkdir',
path: '/var/task/.node-persist'
}
[Error: ENOENT: no such file or directory, mkdir '/var/task/.node-persist'] {
errno: -2,
code: 'ENOENT',
syscall: 'mkdir',
path: '/var/task/.node-persist'
}
RequestId: 0e2a43fd-dcea-4e77-9fcb-a244c1262e07 Error: Runtime exited with error: exit status 1
Runtime.ExitError
vercel.json:
{
"functions": {
"pages/api/**/*.js": {
"includeFiles": "/var/task/.node-persist/**"
}
}
}
this error suggests that /var/task/
dir does not exists, it's failing to create .node-persist
dir, using mkdir
. this a system issue, or maybe vercel doesn't let you create directories or maybe you should create it in your project, put a .gitkeep in it and "includeFiles": ".node-persist/**"
I really can't test this to be honest.
Yeah, turns out vercel doesn't let you use that path even if you explicitly include it. So I switched my storage dir to
await storage.init({ dir: '/tmp/node-persist', logging: true, ttl: 60000 })
and now it's working. Hopefully this solves it going forward.
Great!
Hello, any idea what is the cause of this error? My application is deployed in Vercel, and sometimes it crashes and generates this error.
Thank you!