title: NestJS can't resolve dependencies of the UserController
body: <h2>Current behavior</h2>
  
  <p>Trying to use my <strong>UserService.ts</strong> and <strong>AuthService.ts</strong> in my <strong>UserController.ts</strong>, but I get the following error:
  <code>[ExceptionHandler] Nest can't resolve dependencies of the UserController (?, +). Please make sure that the argument at index [0] is available in the current context.</code></p>
  
  <h2>Minimal reproduction of the problem with instructions</h2>
  
  application.module.ts
  
  <pre><code>import { Module } from "@nestjs/common";
  import { ApplicationController } from "controllers/application.controller";
  import { ApplicationService } from "services/application.service";
  import { AuthModule } from "./auth.module";
  import { UserModule } from "./user.module";
  
  @Module({
    imports: [
      AuthModule,
      UserModule,
    ],
    controllers: [
      ApplicationController,
    ],
    providers: [
      ApplicationService,
    ],
  })
  export class ApplicationModule {}
  </code></pre>
  
  user.module.ts
  
  <pre><code>import { Module } from "@nestjs/common";
  import { UserController } from "controllers/user.controller";
  
  @Module({
    controllers: [
      UserController,
    ],
  })
  export class UserModule {}
  </code></pre>
  
  user.service.ts
  
  <pre><code>import { Injectable } from "@nestjs/common";
  import { InjectRepository } from "@nestjs/typeorm";
  import { Repository } from "typeorm";
  import { UserEntity } from "entities/user.entity";
  
  @Injectable()
  export class UserService {
    constructor(
      @InjectRepository(UserEntity)
      private readonly repository: Repository&lt;UserEntity&gt;,
    ) {}
  
    async findAll(): Promise&lt;UserEntity[]&gt; {
      return await this.repository.find();
    }
  }
  </code></pre>
  
  auth.module.ts
  
  <pre><code>import { Module } from "@nestjs/common";
  import { JwtModule } from "@nestjs/jwt";
  import { AuthService } from "services/auth.service";
  
  @Module({
    imports: [
      JwtModule.register({
        secretOrPrivateKey: "key12345",
      }),
    ],
  })
  export class AuthModule {}
  </code></pre>
  
  auth.service.ts
  
  <pre><code>import { Injectable } from "@nestjs/common";
  import { JwtService } from "@nestjs/jwt";
  import { TokenJwtInterface } from "interfaces/token-jwt.interface";
  
  @Injectable()
  export class AuthService {
    private tokenType;
  
    constructor(private readonly jwtService: JwtService) {
      this.tokenType = "bearer";
    }
  
    public generateTokenJwt(
      payload: object,
      expiresIn: number,
    ): TokenJwtInterface {
      const accessToken = this.jwtService.sign(payload);
  
      return {
        access_token: accessToken,
        token_type: this.tokenType,
        refresh_token: "",
        expires_in: expiresIn,
      };
    }
  }
  </code></pre>
  
  user.controller.ts
  
  <pre><code>import {
    Get,
    Controller,
    Post,
    Body,
    HttpCode,
    HttpStatus,
  } from "@nestjs/common";
  import { UserService } from "services/user.service";
  import { UserEntity } from "entities/user.entity";
  import * as bcrypt from "bcryptjs";
  import { AuthService } from "services/auth.service";
  
  @Controller("/users")
  export class UserController {
    constructor(
      private readonly userService: UserService,
      private readonly authService: AuthService,
    ) {}
  
    @Get()
    async root(): Promise&lt;UserEntity[]&gt; {
      return await this.userService.findAll();
    }
  ...
  </code></pre>
  
  <h2>What is the motivation / use case for changing the behavior?</h2>
  
  <p>Bugfix?</p>
  
  <h2>Environment</h2>
  
  <p>Nest version: 5.1.0 
  For Tooling issues:
  - Node version: v8.11.3
  - Platform:  Ubuntu
  - IDE: VSC</p>