I am running into this error when I deploy my project to deno deploy.
TypeError: Deno.readFileSync is not a function at parseFile (https://deno.land/x/[email protected]/mod.ts59) at config (https://deno.land/x/[email protected]/mod.ts:41:18) at file:///src/src/controllers/users/getUsers.ts:2:19
It's complaining about Prisma db source which it can't read from the env vars although I have provided all my env vars in the project settings. Has anyone else encountered this before or able to guide me. Below are screenshots of the error, the part of code that it's complaining about and the deps file.
You have to only import the
configAsync
function, theconfig
function attempts to call the synchronous function as you noticed.Here is an example of my code importing it for Deno Deploy:
Here is an example of using it:
But probably the more correct way will be to use the replacment dotenv from the std library.