Category "nestjs"

Nest JS .env file variables are undefined even though im using ConfigModule

My variables are undefined but im using .env file in the root of the project that same way it is described in the documentation. Also adding condif imported fro

How to avoid to write `@ApiProperty()` in each dto for NestJs-swagger

I'm researching the way on how to avoid to specify @ApiProperty() in each dto. I know there is exist a way to create file nest-cli.json, and if you specify Prom

can not generate resource nestjs : typeScript

I am getting this error: TypeError: Cannot read property 'properties' of undefined Failed to execute command: node @nestjs/schematics:resource --name=post --

What's the ideal way to add set data to a database in Nest.JS when starting the app for the first time?

I have a database with quite a few tables, and some of those tables need to have default information in them - stuff like categories, permissions, roles, tags,

Problems when migrating to latest nx workspace

I´m facing the same issue since I migrate my nx workspace to the latest version. The workspace contains an angular+nestjs aplications. Everytime I try to

NestJS module import not working in the forRootAsync and forRootMethod of a dynamic module

When trying to import another module inside of my dynamic modules nest throws the following error when using a service exported by that module inside of my serv

NestJS and Prisma ORM : cleanest way to exclude password from response while allow it in requests?

I'm using NestJS with Prisma ORM and kinda of struggling with the use of @Exclude() decorator because when I add it on my UserDto, it also excludes the password

how to secure nest js server on Heroku, I would like to know if the strategy I am using is secure or not

I am hosting my nest js server on heroku. I am using authGuards in nest js to validate the request using accessToken passed by client with the request (this acc

Nest JS Circular Dependency Issue - Mongoose Module

I am trying to inject dependencies in mongoose module for root async. I want to kind of simulate a cascade delete using mongoose hooks. I have this module, whic

map multiple properties to single nested object using typescript and class-transformer

I'm using class-transformer (in nestjs) to convert my database entities into dto types to output from my api. My database entities look like: class MyEntity {

Extending tsconfig files not resolving the paths properly?

I am getting an issue with tsconfig after upgrading the package version. Below is my folder structure (simplified, but keeping the actual hierarchy): The tsconf

vsCode dependencies bug with nestJs

my vsCode bug to recognize dependencies when i program with nestJs, after setting up the project with: nest new projectname then after running for example: npm

Using Auth0 with NestJS on gRPC Methods

I am trying to implement NestJS Guards for Authentication and Authorization to my gRPC Services, which are implemented in NestJS. @GrpcMethod(USER_SERVICE_NAME,

What is the correct type of Exception to throw in a Nestjs service?

So, by reading the NestJS documentation, I get the main idea behind how the filters work with exceptions. But from all the code I have seen, it seems like all s

TypeORM OneToMany and ManyToOne relations cases 500 error on GET request

After adding OneToMany and manyToOne relations in the entities and doing GET request it shows in postman 500 error. // Car entity @Entity({ name: 'car' }) expor

How to accept multiple objects into an array NestJS

I have a feedbackQuestion schema which takes (title: string, subtitle: string, types: enum, values: enum) import { Prop, Schema, SchemaFactory } from '@nestjs/m

How do I read an uploaded file (text/.csv) using nestjs and Multer

I need to read my CSV file in the controller to add CSV file data into my DB. But I don't know the way to that. I search for an answer so many times but I can't

How to fix "can not fin'd bcrypt" in NestJS?

As found in this SO-answer, the following thing could be a way how to encrypt a password into a hash: @BeforeInsert() async hashPassword() { this.password

How to set up NestJS microservices integration/e2e testing KafkaJS consumer (MessagePattern/EventPattern handler)

I'm proofing out an integration test with NestJS/KafkaJS. I have everything implemented except the function on the event listener (consumer) for the topic I'm e

UnhandledPromiseRejectionWarning: Error: Not Found While sending email from Nestjs

I am trying to develop a mail sending module in my NestJs project. when I send the mail through my local machine it works fine. But when it goes to the server (