Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

374
Vistas
Compilation issues in Nest.js when changes made in a service.ts file

I am working on a Nest.js project and this is what I have in the automobile.service.ts

import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Car } from './entities/car.entity';
import { Repository } from 'typeorm';

import { CreateAutoDto } from './dto/create-auto.dto';
import { UpdateAutoDto } from './dto/update-auto.dto';


export class AutoService {
  constructor(
    @InjectRepository(Car)
    private autoRepository:Repository<Car>,
  ){}


  create(createAutoDto: CreateAutoDto) {
    return this.autoRepository.save(createAutoDto)

The issue I am facing right now is, after I typed nom run start:dev in the terminal, the log just stopped from here:

[Nest] 234 - 10/10/2021, 7:36:53 PM [NestFactory] Starting Nest application...

[Nest] 234 - 10/10/2021, 7:36:54 PM [InstanceLoader] TypeOrmModule dependencies initialized +958ms

Nothing more, and with that I can't open the page in browser. However, if I have the whole

constructor(
    @InjectRepository(Car)
    private autoRepository:Repository<Car>,
  ){}

thing deleted, the code finishes compiling without any error.

[Nest] 101 - 10/10/2021, 7:05:57 PM [NestApplication] Nest application successfully started +3ms

I am new to Nest.js. What could be the root-cause here?

EDIT: In automobile.module.ts

import { AutoService } from './automobile.service';
import { AutoController } from './automobile.controller';

@Module({
  controllers: [AutoController],
  providers: [AutoService],
})
export class AutoModule {}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

So what I did wrong was that in automobile.module.ts file, I forgot to include imports: [TypeOrmModule.forFeature([Car])], and that might be the root-cause resulting in the timeout on the DB connection.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda