#.env values not being loaded up in environment?

15 messages · Page 1 of 1 (latest)

scarlet copper
#

I have an .env file like I do with a dozen other nestjs projects, but for some reason, on this particular project they do not appear to be loaded into the environment.

Logging the whole process.env contents does not display any of the values I have in there.

Any ideas where I could look to debug this?

quick canopy
#

You'd have to share how you're loading that file, to begin with

scarlet copper
#

tbh I thought it just automatically works

#

it appears to be the case on the other projects I copied things over from

quick canopy
#

nor nestjs nor nodejs load them automatically

#

and there are couple ways to do so

#

try nest start --env-file .env
(assuming that you're using nestjs v11)

leaden sun
scarlet copper
#

I am using prisma on all of the other ones indeed

#

--env-file .env doesn't seem to do the trick 😦

#

will try dotenv, should be plenty of ways to load it

#

was just super-confused as to why it's not working for this particular project as i haven't touched anything, but it seems to be prisma loading it in all the other ones

quick canopy
leaden sun