title: Nest can't resolve dependencies of the VendorsService (?). Please verify whether [0] argument is available in thecurrent context
body: <p>I am new to nest js and typescript also. Thanks in advance.</p>
  
  <p>I am getting this error continuously. </p>
  
  <p><strong>Nest can't resolve dependencies of the VendorsService (?). Please verify whether [0] argument is available in thecurrent context.</strong></p>
  
  <p>Here is the code</p>
  
  <p><strong>App module</strong></p>
  
  <pre><code>@Module({
    imports: [ UsersModule, VendorsModule],
  })
  export class ApplicationModule {}
  </code></pre>
  
  <p><strong>controller</strong></p>
  
  <pre><code>@Controller()
  export class VendorsController {
      constructor(private readonly vendorService: VendorsService){}
  @Post()
  async create(@Body() createVendorDTO: CreateVendorDTO){
      this.vendorService.create(createVendorDTO);
  }
  
  @Get()
  async findAll(): Promise&lt;Vendor[]&gt;{
      return this.vendorService.findAll();
  }
  }
  </code></pre>
  
  <p><strong>Service</strong></p>
  
  <pre><code>@Injectable()
  export class VendorsService {
  
      constructor(@Inject('VendorModelToken') private readonly vendorModel: Model&lt;Vendor&gt;) {}
  
      async create(createVendorDTO: CreateVendorDTO): Promise&lt;Vendor&gt;{
          const createdVendor = new this.vendorModel(createVendorDTO);
          return await createdVendor.save();
      }
      async findAll(): Promise&lt;Vendor[]&gt;{
          return await this.vendorModel.find().exec();
      }
  }
  </code></pre>
  
  <p><strong>provider</strong></p>
  
  <pre><code>export const usersProviders = [
    {
      provide: 'VendorModelToken',
      useFactory: (connection: Connection) =&gt; connection.model('Vendor', VendorSchema),
      inject: ['DbConnectionToken'],
    },
  ];
  </code></pre>
  
  <p><strong>Module</strong></p>
  
  <pre><code>@Module({
    providers: [VendorsService],
    controllers: [VendorsController],
  })
  export class VendorsModule {}
  </code></pre>