moubliniM
Denoโ€ข3y agoโ€ข
3 replies
moublini

Unable to load env variables in local

I'm starting again with deno since a long time with a small telegram bot using the grammy framework, and since i need an API key i have to store it in environment variables. Those .env files are stored inside the src/environment folder, and when i call the function loadSync from the dotenv library in
deno.land/std
with export=true and the correct environment file paths it does not load them. In fact I've also tried seeing if the object that loadSync would return contained any of my variables and it's completely empty.
I'm really confused as a long time ago i never had a slight problem using the dotenv library. I've also put the --allow-all flag before running the process and it just doesn't read them. Just to be more explicit this is the command I'm running: deno run --allow-all --watch src/index.ts where index.ts is the entry point of the application.
Schermata_2023-10-15_alle_15.46.14.png
Was this page helpful?