My dotenv is not working in another directory, i have tried all kinda stuff already, but my variables always throw a error saying is undefined. Here is how my files are structured.
|-project
|-src
|-folder
|-model.ts
|-index.ts
|-.env
index.js:
import * as dotenv from 'dotenv';
dotenv.config();
model.ts:
import * as dotenv from 'dotenv';
import * as path from 'path';
dotenv.config({path: path.resolve(__dirname,'../../.env')});