title: NestJS. Can't inject a repository from a different module
body: <p>I am trying to use a <em>typeorm custom repository</em> defined in another module.</p>
  <p>Following the <a href="https://docs.nestjs.com/techniques/database#typeorm-integration" rel="nofollow noreferrer">documentation</a>:</p>
  <blockquote>
  <p>If you want to use the repository outside of the module which imports TypeOrmModule.forFeature, you'll need to re-export the providers generated by it. You can do this by exporting the whole module, like this:</p>
  </blockquote>
  <pre><code>@Module({
    imports: [TypeOrmModule.forFeature([Role])],
    exports: [TypeOrmModule]
  })
  export class RoleModule {}
  </code></pre>
  <blockquote>
  <p>Now if we import UsersModule in UserHttpModule, we can use @InjectRepository(User) in the providers of the latter module.</p>
  </blockquote>
  <p>In my case i do:</p>
  <pre><code>@Module({
    imports: [RoleModule],
    providers: [UsersService],
    controllers: [UsersController]
  })
  export class UserModule {}
  </code></pre>
  <p>Now when i inject the Role repository</p>
  <pre><code>export class UserService {
    constructor(@InjectRepository(Role) private roleRepository: Repository&lt;Role&gt;) {}
  }
  </code></pre>
  <p>i've got an error:
  <code>Nest can't resolve dependencies of the UserService (?).</code></p>
  <p>Is it me or is the documentation incorrect?
  Can someone suggest what is the error here or give a corrected example?</p>