Questions tagged [nestjs-config]
196 questions
0
votes
1 answer
How to use process.env before @Module() in app.module.ts
In order to apply the value of synchronize dynamically, the following code was written.
I executed the next cli
$ nest new project
$ npm i --save @nestjs/config
This is my code
/.env
# related to server
SERVER_MODE = dev
SERVER_PORT = 3000
#…

ChangMin
- 3
- 2
0
votes
2 answers
Typescript Undefined and ? do not take effect in NestJS (like i haven't use them)
In my nest project in which I use the default tsconfig.json which was generated when i initiated the project
npm i -g @nestjs/cli // (version ^9.0.0)
nest new project-name
typescript does not take into account undefined and ?.
For example in the…

prof chaos
- 404
- 3
- 18
0
votes
1 answer
NestJS .env variables undefined from AppModule
I set up a NestJS project that uses TypeORM with Postgres - Docker. TypeORM successfully connects to my Postgres DB when I hardcode the connection values into the config, but not when using environment variables.
To test whether .env vars get read…

DeonV
- 192
- 6
0
votes
1 answer
How to setup migrations along with ConfigModule in Nestjs
I am trying to figure out a way to setup migrations with typeOrm 0.3.12 in Nestjs along with ConfigModule.The database to be used in this project is Postgres. I have two problems:
When trying to generate migrations, I will get the message that 'No…

codeless
- 33
- 4
0
votes
0 answers
Nestjs and GraphQL server accessible on Localhost only
I created an api using NestJs and GraphQL, exposing a GraphQL server (Apollo) with a certain port.
Everything works fine as long as I am using http://localhost:3001/graphql endpoint. As soon as I change to http://:3001/graphql the…

iiSam
- 61
- 5
0
votes
1 answer
property signin, sign up does not exist on type AuthService
auth.controller file
`import { Test, TestingModule } from '@nestjs/testing';
import { AuthController } from './auth.controller';
describe('AuthController', () => {
let controller: AuthController;
beforeEach(async () => {
const module:…

umair
- 9
- 1
0
votes
1 answer
NestJS compilerOptions assets wrong path
I don't really know hot to explain it but basically I have .hbs files which the mail resource needs. Normally they don't get copied into the dist folder when I run npm start run:dev. So I modified the nest-cli.json like this.
But now I have the…

Specht
- 50
- 10
0
votes
1 answer
NestJS: How to build and deploy the nestJS app only with javascript
I've implemented a NestJS app in Javascript without the TS support. And I would like to deploy it. I'm wondering how one can achieve that. All the documentation points to how to do that using typescript. Using a nest build command, mentioned here in…

Parag Pawar
- 827
- 3
- 12
- 23
0
votes
1 answer
ConfigService is undefined while running testcases in Nest.js
I am running nestjs server locally and if I test with postman it works fine. But when I run testcases, the ConfigService gets undefined!
app.module.ts
@Module({
imports: [
ConfigModule.forRoot({ load: [configuration], isGlobal: true }),
…

Prashant Patel
- 21
- 3
0
votes
1 answer
@nrwl/nest start the server every time I hit save
I use NX Workspace with NestJS, and my issue is that every time I save something in the project, the entire program restarts without shutting down the previous app.
How could I restart the server?
This is the project.json file (inside the…

Serban Marin-Eusebiu
- 31
- 4
0
votes
1 answer
What is the difference depending on where the global validation pipe is set in Nest.js?
There are two different ways to apply validation pipe globally. I can't figure out the difference between those.
method 1
// app.module.ts
import { APP_PIPE } from '@nestjs/core';
@Module({
providers: [
{
provide: APP_PIPE, // <--…

user14082
- 311
- 3
- 10
0
votes
2 answers
yarn start:dev not working, not changes the code - Nest.js
enter image description here
my code is returning the same value even if i change the code
I want to know what happened

Kauan
- 23
- 1
- 3
0
votes
1 answer
Why is my Config service injection not working
Screenshot of the error after trying the solution
I get the following error
Cannot read properties of undefined (reading 'get')
Here is my code from the files.
@Injectable()
export class EVMService {
public web3: Web3;
@Inject(ConfigService)
…

Hardil Singh
- 11
- 5
0
votes
1 answer
NestJS lifecycle methods invoked without implementing their interface
I am having a small question about NestJS. In my code, there is a service which looks something like:
`
import { Inject, Injectable } from '@nestjs/common';
import neo4j, { Driver, int, Result, Transaction } from 'neo4j-driver';
import {…

kiroroki
- 3
- 1
- 2
0
votes
2 answers
How use seeding options in MikroOrm with nestJs?
I'm using MikroOrm inside nestJs, and I added the following script inside package.json
"orm": "npx mikro-orm",
and these are the configurations
seeder: {
path: 'src/misc/db/',
defaultSeeder: 'DatabaseSeeder',
glob: '!(*.d).{js,ts}',
emit:…

Abdlrahman Saber
- 144
- 1
- 7