Questions tagged [nestjs-config]
196 questions
0
votes
1 answer
How to create Generic Entity Subscriber
I am working with NestJs and typeorm with Postgres Database to develop a feature to save the json of what ever get updated in the entities (maintaing update and insert logs).
I am trying to use Entity Subscriber feature of typeorm, which is working…

Ankit Halder
- 167
- 1
- 4
- 16
0
votes
1 answer
Handling with more than one useGlobal on Nestjs
My question is quite simple, I'm trying to use GlobalFilters with GlobalPipes, the pipes I use for validating the payload sent to the API and the filters are responsible to handle the error during execution of API calls. But when the pipe tries to…

Guilherme Gonzalez
- 103
- 1
- 9
0
votes
0 answers
NestJS timeout for prevent duplicates
I have an application in NestJS, when a request is made to create an object, it validates that an object with the same name and some other parameters does not exist, in those validations the process takes approximately 30 seconds, before actually…

laur
- 500
- 1
- 9
- 23
0
votes
1 answer
How to use observable data from an external api in nestjs?
Im trying to use from a external api in nestjs with axios.
@Injectable()
export class PIntegration {
constructor(private httpService: HttpService) { }
API = process.env.API || 'http://localhost:3000';
header = { headers: { 'Content-Type':…

alex
- 113
- 2
- 14
0
votes
1 answer
Error: self signed certificate nestjs TypeOrmModule
I'm trying to deploy my API to Heroku but when it's starting it shows the following error
2021-10-28T02:57:12.498187+00:00 app[web.1]: [Nest] 22 - 10/28/2021, 2:57:12 AM ERROR [TypeOrmModule] Unable to connect to the database. Retrying…

Santiago molano perdomo
- 142
- 2
- 12
0
votes
1 answer
Fix for "Nest can't resolve dependencies of the MovieService."
I keep getting this error but don't know why. If anyone could help me solve it, that would make my day
Error: Nest can't resolve dependencies of the MovieService (?). Please make sure that the argument MovieRepository at index [0] is available in…

LucentDread
- 1
- 4
0
votes
1 answer
NestJS Configuration in a Nrw Nx Monorepo?
I've just started using Nx and I'm moving my existing project over to a Monorepo environment.
The problem I have is with the NestJs app. For some reason the configuration file never gets read. I've tried moving it to different locations but I can't…

K-Dawg
- 3,013
- 2
- 34
- 52
0
votes
0 answers
Nestjs validate nested object using validationSchema
a: {
b: 'c'
}
I'm trying to validate it using Joi, inside my module:
ConfigModule.forRoot({
envFilePath: ['config.env'],
load: [generalConfig],
validationSchema: Joi.object({
a: Joi.object({
b:…

MoreOver
- 381
- 1
- 5
- 17
0
votes
1 answer
typeorm connection.createQueryRunner is not a function when used in nestjs
I have a project that's using nestjs with typeorm.
There's a database.config.ts:
const entitiesPath = join(__dirname, '..', 'entities', '*.entity.{ts,js}');
const migrationsPath = join(__dirname, '..', 'migrations', '*.*');
const subscribersPath =…

chenny
- 769
- 2
- 17
- 44
0
votes
2 answers
In typeorm with nestjs, ormconfig.json is not getting detected
I am relatively new to using typeorm. I am trying to separate the ormconfig.json for production and development environment but I keep getting this error:
Error during migration generation:
Error: Cannot find connection default because its not…

Shiladitya Thakur
- 264
- 5
- 19
0
votes
0 answers
Role based Auhtorization is not working as expected in nestjs
I have followed the NestJs documentation and added the following rolebased auth guards which is not working.
I always get headers undefined or context.switchToHttp().getRequest() is undefined.
I am using graphql with nestjs.
My…

Yashwanth Kata
- 817
- 8
- 21
0
votes
1 answer
Not able to load environment specific config in NestJS
I have created three env files : .env ,.env.test,.env.prod in my root directory.
.env file…

Yashwanth Kata
- 817
- 8
- 21
0
votes
2 answers
NestJS EventEmitter
I'm following the NestJS docs for creating an EventEmitter (Doc Link.
When I running my code I'm getting an error :
"[Nest] 129586 - 16/06/2021, 20:43:31 [ExceptionsHandler] this.eventEmitter.emit is not a function"
This is what my code looks…

Rohit
- 35
- 1
- 7
0
votes
1 answer
Fix for "Nest can't resolve dependencies of the CashInService."
Why do I keep getting this error saying
Error: Nest can't resolve dependencies of the CashInService (?). Please make sure that the argument CashInRepository at index [0] is available in the AppModule context.
This is the structure of my…

birukhimself
- 193
- 3
- 14
0
votes
1 answer
Nestjs: Unable to read 'env' file variables
I am unable to read env file variables in the App Module. It's really strange that I those variables are accessable in "main.ts" file.
Here's the code in App Module:
console.log(process.env.DB_URI); // logs undefined
@Module({
imports: [
…

Sachin Yadav
- 128
- 3
- 12