So i have a Nest application and have gotten stuck on what feels like a very basic issue.
I need to use the PlaceVerificationRequestService in the PlaceService but cant inject it properly without receiving the following error:
Nest can't resolve dependencies of the PlaceService (PlaceRepository, ClientService, ?). Please make sure that the argument dependency at index [2] is available in the PlaceModule context.
My approach has been to just follow the same style as i did when importing & injecting the ClientService in to PlaceService but still it does not work and i cant figure out why.
This is my code.
place.module.ts
@Module({
imports: [
MikroOrmModule.forFeature({
entities: [Place, Client, PlaceVerificationRequest],
}),
],
providers: [PlaceService, ClientService, PlaceVerificationRequestService],
controllers: [PlaceController],
exports: [PlaceService],
})
place-verification-request.module.ts
@Module({
imports: [
MikroOrmModule.forFeature({
entities: [PlaceVerificationRequest, Client, Place],
}),
],
providers: [PlaceVerificationRequestService, ClientService, PlaceService],
controllers: [PlaceVerificationRequestController],
exports: [PlaceVerificationRequestService],
})
place.service.ts
@Injectable()
export class PlaceService {
constructor(
@InjectRepository(Place)
private readonly placeRepo: EntityRepository<Place>,
private readonly clientService: ClientService,
private readonly reqService: PlaceVerificationRequestService,
) {}
It feels like im missing something that is right in front of my nose since it feels very basic but i cant seem to spot it. Anyone that has a clue? thanks