Nest can't resolve dependencies in completely identical files

13 Views Asked by At

Here is my module file

  imports: [
    AgentProfileModule,
    ExclusionModule,
    FeatureFlagModule,
    ShiftReviewModule,
    WorkerModule,
    ShiftsModule,
    PriorityAccessModule,
  ],
  controllers: [UrgentShiftsController, UrgentShiftsControllerV2],
  providers: [
    UrgentShiftsBatchNotificationService,
    UrgentShiftsNotificationService,
    UrgentShiftsNotificationRepository,
    UrgentShiftsRepository,
    UrgentShiftsService,
    WorkerDepartureService,
    UrgentShiftsNotificationLayeringService,
    FacilityProfileRepo,
  ],
  exports: [UrgentShiftsNotificationService, UrgentShiftsRepository],
})
export class UrgentShiftsModule {}

My issue is that the first controller is having zero dependency injection issues. My second controller UrgentShiftsControllerV2 is not able to import UrgentShiftsService.

Here's the thing, even when I make the code in UrgentShiftsControllerV2 completely identical to UrgentShiftsController (which also imports UrgentShiftsService) it still gets the dependency issue.

Has anyone dealt with dependency issues from completely identical files before?

0

There are 0 best solutions below