Cannot read JSON file from server action when deployed to Vercel. #58512
Replies: 7 comments
-
I get exactly the same error.. |
Beta Was this translation helpful? Give feedback.
-
Same error here ENOENT: no such file or directory, open '/var/task/app/contact_email.html'
|
Beta Was this translation helpful? Give feedback.
-
Same issue here, any update on this ? |
Beta Was this translation helpful? Give feedback.
-
Same here |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Any updates on this? would be good to clarify since its an official blog post |
Beta Was this translation helpful? Give feedback.
-
There are even a second incorrect documentation page here: https://vercel.com/guides/how-can-i-use-files-in-serverless-functions Vercel started out simple but is becoming more like AWS every day :/ |
Beta Was this translation helpful? Give feedback.
-
Summary
I tried reading a JSON file from a Server Component like explained in this blog post - It works great.
My problem is that I want to read the same JSON file from a server action, which works on localhost but doesn't work when deployed to Vercel. I get an error
ENOENT: no such file or directory
.My server action file is very simple:
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions