Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

372
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!