Category "nestjs"

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 (

Send Response to one Room does not work (Nestjs & Socketio)

My goal is to emit to only one client by using the default room that is being created by socketIo. The room id and client id match. I checked that by logging it

Mock Injected Twilio Service in Unit Testing Nest.js

I have a problem with overriding provider/setup module testing in nest.js application for testing. Module file: smsModule.ts: import { TwilioService } from './t

ERROR [ExceptionsHandler] Cannot read properties of null (reading 'concat')

Here What I did is I have a user entity and a role entity. Every user can have one role. I have set up many-one relationship in role entity. I have create an en

How to Unit Test a method inside a module in NestJs (Jest)

I'm adding tests on a project and improving coverage. I would like to know how can I test a method defined inside a module definition in NestJs. import { Middle