server dir with nextjs and drizzle

So Im configuring a drizzle and nextjs app router application
In the server directory, my env keys dont work unless i add:
import {config} from 'dotenv';

config ({
    path: '.env',
});


is there a reason for this?
i thought I jsut need to do process.env.VALUE (works in api routes)
Was this page helpful?