Module Not Found Error
Answered
Keyhole wasp posted this in #help-forum
Keyhole waspOP
I have a static file stored which is storagecredentials.json, which I use for GCP. All functionality is working on my local machine,
But when I deploy to vercel - it shows me module not found error:
An error occurred: Error: ENOENT: no such file or directory, open '/var/task/apps/web-app/public/storagecredentials.json'
But when I deploy to vercel - it shows me module not found error:
An error occurred: Error: ENOENT: no such file or directory, open '/var/task/apps/web-app/public/storagecredentials.json'
5 Replies
@Keyhole wasp I have a static file stored which is storagecredentials.json, which I use for GCP. All functionality is working on my local machine,
But when I deploy to vercel - it shows me module not found error:
An error occurred: Error: ENOENT: no such file or directory, open '/var/task/apps/web-app/public/storagecredentials.json'
files in the
public folder no longer remains there when you deploy on vercel. you should be using [environment variables](https://nextjs.org/docs/app/building-your-application/configuring/environment-variables) instead of the credentials file.Keyhole waspOP
no, i dont't think so
It works for other files
@joulev files in the `public` folder no longer remains there when you deploy on vercel. you should be using [environment variables](<https://nextjs.org/docs/app/building-your-application/configuring/environment-variables>) instead of the credentials file.
Keyhole waspOP
I changed the path.join(process.cwd()) and now it picks up
Answer
Keyhole waspOP
maybe vercel has different architecture