Questions tagged [nestjs-config]

196 questions
1
vote
1 answer

failed to upload image in nestjs

I am newbie in backend especially nodejs, I am using nestjs as framework. I want to make the name of my uploaded file https://mydomain/files/example-image.png, but I get an error like this: Error: ENOENT: no such file or directory, open…
1
vote
0 answers

jsconfig.js file not working with symlink package

I have a React node repo that imports from a custom node repo. Both repos are located in my local machine. I have jsconfig.js files in both repo, using VS code. However, only the React repo is recognizing the jsconfig.js file. The jsconfig.js file…
1
vote
1 answer

Unable to set headers in nestjs

I am learning nest.js and I am having a hard time setting the response headers.. Here is the code snip @Controller() export class AppController { constructor(private readonly appService: AppService) {} //@get('users') @Get() …
Juan Casas
  • 268
  • 2
  • 13
1
vote
1 answer

Infinite retries when using RpcFilter in NestJS microservice setup with Kafka

I am new to Kafka and I am experiencing a mixed behaviour when trying to setup proper error handling on my consumer when there is an error. In few instances I am observing retry policy in action - kafka retries my message 5 times(as what I…
1
vote
1 answer

How to import a file for different environment with NodeJS?

There are two files under src folder. main.ts tracing.ts I want to import tracing in the main.ts only on local environment. main.ts 1 if(process.env.NODE_ENV === 'local') { 2 import './tracing' 3 } 4 import { ConfigService } from…
Alpin Cleopatra
  • 163
  • 3
  • 14
1
vote
1 answer

Nestjs: Repl with monorepo mode

I have a nest app that is using monorepo mode. I would like to take advantage of the new repl feature that was released in nest 9.0+. My directory structure looks as such: apps/ --inventory-ops/src/app.module --ticket-office/src/app.module I have…
Paul T
  • 1,455
  • 11
  • 15
1
vote
0 answers

Nestjs: Helmetjs x-frame-option not working live but working in local

I install helmetjs and test in local is working fine and prevent clickjacking. Same code push into live clickjack prevent not working and x-frame option not visible in network response.
sakthi vel
  • 11
  • 1
1
vote
1 answer

NestJS Kafka Microservice with REST Endpoints

I am new to NestJS and was wondering if its possible to have a NestJS Kafka micro-service with REST Endpoints as well (ideally using Fastify). I have found the following configuration for both Kafka and for Fastify but it seems like you can only…
mh377
  • 1,656
  • 5
  • 22
  • 41
1
vote
1 answer

How do I access process.env.* from @nestjs/config in my Strategy service constructor?

I tried setting isGlobal: true in app.modele.ts but process.env.* returned undefined. @Module({ imports: [ ConfigModule.forRoot({ isGlobal: true, envFilePath, }), ... }) export class AppModule {} Next, I tried…
user1452701
  • 144
  • 1
  • 10
1
vote
1 answer

NestJs: Why is monorepo mode only packaging root app,

I have a Nest project set up in monorepo mode. However, when I run yarn build, Nest only puts the root app in the dist folder. Here's when my project structure looks like: . └── cloud-kruser-backend ├── apps │ ├── root-app │ │ ├──…
Justin Kruse
  • 1,020
  • 12
  • 27
1
vote
1 answer

Manually register a typeorm EventSubscriber in NestJS without specifying it in the configuration file

In NestJS I extended the class EntitySubscriberInterface to create a generic EventSubscriber. My goal is to catch all the typeorm repository events 'beforeInsert' every time that I insert something in the DB (it should be triggered for all the…
Jacob
  • 595
  • 1
  • 7
  • 25
1
vote
0 answers

Can't install nestjs-cli v9

I tried to run npm i -g @nestjs/cli The installation hang on reify:rxjs: timing reifyNode:node_modules/@nestjs/cli/node_modules/@angular-devkit/schematics-cli/node_modules/rxjs I tried with node v16 v14 npm 8.18. I tried increase npm timeout,…
user8987378
  • 182
  • 1
  • 2
  • 17
1
vote
1 answer

How to fix the error "no pg_hba.conf entry for host" from Heroku in NestJS

I configured TypeORM for Heroku using a guide and the ormconfig.js looks like this: const dbConfig = { synchronize: false, migrations: ['migrations/*.js'], cli: { migrationsDir: 'migrations', …
r00k13
  • 215
  • 3
  • 15
1
vote
2 answers

NestJS Reading File - No Such File or Directory

I am having trouble getting my nestJS app to read my cert secret file and even a simple txt file. I am getting the error: ERROR [ExceptionsHandler] ENOENT: no such file or directory Below is all I am doing, using fs to read the file: import…
Mabel Oza
  • 557
  • 8
  • 22
1
vote
0 answers

Timestamp is not generate

createdAt?: Date; Here is my code on postInterface @CreateDateColumn({ type: "timestamp", default: () => 'CURRENT_TIMESTAMP'}) createdAt: Date; Here is my code on postEntity. And on my postgres database table, I selected timestamp without…
Anas Isah
  • 47
  • 7