title: Nest.js can't resolve dependencies
body: <p>I am trying to use <code>ConfigService</code> in my <code>users.module.ts</code> but I am getting an</p>
  
  <blockquote>
    <p>Error: Nest can't resolve dependencies of the UsersService (UserRepository, HttpService, ?). Please make sure that the argument ConfigService at index [2] is available in the UsersModule context.</p>
  </blockquote>
  
  <p>Potential solutions:</p>
  
  <ul>
  <li>If ConfigService is a provider, is it part of the current
  UsersModule? </li>
  <li>If ConfigService is exported from a separate @Module, is
  that module imported within UsersModule?</li>
  </ul>
  
  <p>I have imported the ConfigModule in my UsersModule but still its not working :(</p>
  
  <p><strong>app.module.ts</strong></p>
  
  <pre><code>@Module({
    imports: [
      ConfigModule.forRoot({
        expandVariables: true,
      }),
      TypeOrmModule.forRoot(),
      UsersModule,
      AuthModule,
    ],
    controllers: [AppController],
    providers: [AppService],
  })
  
  export class AppModule {}
  </code></pre>
  
  <p><strong>users.module.ts</strong></p>
  
  <pre><code>import { ConfigModule } from '@nestjs/config';
  
  @Module({
    imports: [ConfigModule, HttpModule, TypeOrmModule.forFeature([User])],
    controllers: [UsersController],
    providers: [UsersService],
    exports: [UsersService],
  })
  
  export class UsersModule {}
  </code></pre>
  
  <p><strong>users.service.ts</strong></p>
  
  <pre><code>export class UsersService {
  
   constructor(
      @InjectRepository(User)
      private readonly userRepository: Repository&lt;User&gt;,
      private readonly httpService: HttpService,
      private readonly configService: ConfigService,
    ) {}
  
  }
  </code></pre>