Closed nayan2 closed 1 year ago
Same here. I'm using dotenv
for the config. As soon as I try to execute a console script, it errors at the first env variable it does not know.
// app.module.ts
import * as dotenv from 'dotenv'
import { Global, Module } from '@nestjs/common'
import { ConfigModule } from '@nestjs/config'
import { ConsoleModule } from 'nestjs-console'
dotenv.config()
@Global()
@Module({
imports: [
ConfigModule.forRoot({ isGlobal: true }),
ConsoleModule,
],
})
export class AppModule {}
Can you create a small reproduction repo so i can investigate this ?
Hei, thanks for the reply. But, the issue has been Fixed.
In my main module - which is
CLIMODULE
, I am addingConfigModule
, which is recommanded by nestJs. But when I am logging process.env inside it. I am getting. something unexpected. Unbale to unbale why?The process.env should give me. the project local
.env
file varibales or OS environment varibale.My Module ->
Any, idea how can I get the local 'environment' variables? OR from a local
.env
file.