79470751

Date: 2025-02-26 18:38:04
Score: 0.5
Natty:
Report link

If you use nestjs dependency injection, you must prefix the repository in the constructor of the service with @InjectRepository(TheEntityName), or you will get this similar error:

"Nest can't resolve dependencies of the TheServiceName (?). Please make sure that the argument Repository at index [0] is available in the AppModule context."

constructor(
  @InjectRepository(EntityName) private readonly myEntityRepoVariable: Repository<EntityName>
) {}
Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: yg-dba