Questions tagged [nestjs-config]
196 questions
1
vote
2 answers
NestJs | Set max header size
I am implementing API in NestJs and new to this framework. For one of my API I am getting error as
Status Code: 431 Request Header Fields Too Large
To fix this issue I want to change max header size in NestJs configuration. Where do I change this…

CodeWarrior
- 763
- 3
- 14
- 33
1
vote
1 answer
nestjs upload file and image system
I want to create a file uploader section.
I put the following code in order:
app.module.ts :
imports: [
MulterModule.register({
dest: './uploads',
}),
]
files.controller.ts :
@Post('upload')
@UseInterceptors(FileInterceptor('file'))
…

moh
- 205
- 1
- 3
- 6
1
vote
1 answer
NetsJs Controller Unit Testing returning TypeError: Cannot read property of undefined
Trying to write unit test's on NetsJs Controller But getting Returning TypeError: Cannot read property 'getGroup' of undefined
groups.controller.spec.ts
describe("GroupsController", () => {
let groupsController: GroupsController;
let…

nilesh suryavanshi
- 398
- 3
- 17
1
vote
1 answer
how to use DynamicModule in config case?
all, how to use DynamicModule in config case?
https://github.com/nestjs/nest/blob/master/sample/25-dynamic-modules/src/config/config.service.ts#L12 for official example.
After config like official Example:
import { Inject, Injectable } from…

wei L.
- 61
- 1
- 4
1
vote
1 answer
NestJS can't resolve dependencies of the JWT_MODULE_OPTIONS (Same problem, different solution)
This is not duplicate! I saw same problem here, but solution not helped.
My NestJS instance is not starting because of this problem:
Nest can't resolve dependencies of the JWT_MODULE_OPTIONS (?). Please make sure that the argument ConfigService at…

Baterka
- 3,075
- 5
- 31
- 60
1
vote
1 answer
How to get config in controller route of NestJS?
I'm trying to get a variable to appear through both the controller prefix and the method path parameters of the decorators. I know of Nest Router, but I'd rather avoid using it while I can.
/*************************
*…

yaserso
- 2,638
- 5
- 41
- 73
1
vote
1 answer
Prevent automatic server restart when running in watch mode upon making changes to certain folders
I run my NestJS application in watch mode.
Normally, whenever I make changes to the file in the code, it restarts the server which is the expected behaviour.
I used the default nest start --watch command to perform this.
However, in certain…

Nechar Joshi
- 630
- 1
- 7
- 14
0
votes
1 answer
NestJS Service/Validator throws TypeError: Cannot read properties of undefined (reading 'get') Any of the injected objects are not available
I have the following NestJS Validator Service
@ValidatorConstraint({ async: true })
@Injectable()
export class IsValidWorkingHourConstraint implements ValidatorConstraintInterface {
private readonly WORKING_HOUR_START: number;
private readonly…

Peter Sz.
- 3
- 1
- 4
0
votes
0 answers
Automating TypeORM Migrations for NestJS App Deployed on Azure Container Registry
I'm currently working on a NestJS application that utilizes TypeORM. Our deployment process involves Azure DevOps pipelines, pushing to Azure Container Registry, and deploying to a web app.
This is my first time working with TypeORM, and I'm curious…

Sam
- 1
- 1
0
votes
2 answers
How to disable prettier in nest js
I'm using Nest JS, but Prettier keeps bothering me with formatting errors while I'm trying to develop. It's frustrating because it distracts me from actual coding. How can I turn off Prettier just for now and then turn it on again when I want?
I…

nadendla tharak
- 11
- 3
0
votes
1 answer
Resolving NestJS dependency
I have encountered this error when trying to execute npm install @nestjs/microservices:
# npm resolution error report
While resolving: [appName]
Found: @nestjs/common@9.4.3
node_modules/@nestjs/common
@nestjs/common@"^9.4.3" from the root…

Cookie
- 17
- 3
0
votes
0 answers
problem with load env files for each apps in nest microservice
I have nest application which contains two apps : auth and reservations
I want to create .env file for each of them
I define a .enf file in each folder but in configService i still get error
but when i create a .env file in main root directory every…

nima M
- 1
0
votes
1 answer
Nest js dependency injection is not working
Am working on a NestJS project. The aim of this project is to list the s3 buckets.
I am using aws-sdk for aws support. Here am using the code. The issue is in my AWSService.ts file
import { Injectable } from '@nestjs/common';
import { S3 } from…

arj
- 887
- 1
- 15
- 37
0
votes
0 answers
Nest can't resolve dependencies of the UsersLineService (UsersLineRepository, HttpService, ?)
Error
[Nest] 20898 - 07/23/2023, 6:09:36 PM ERROR [ExceptionHandler] Nest can't resolve dependencies of the UsersLineService (UsersLineRepository, HttpService, ?). Please make sure that the argument dependency at index [2] is available in the…
0
votes
1 answer
NestJS DI - useFactory using request
In nestJS it is said that we can read properties from the request and insert into DI like this:
@Module({
controllers: [UserController],
providers: [
{
provide: 'USER',
scope: Scope.REQUEST,
…

Zoltan Hernyak
- 989
- 1
- 14
- 35