From 5b0d105788bae2e63b96ca2efd024127bcce5130 Mon Sep 17 00:00:00 2001 From: wangdl Date: Sun, 21 Jun 2026 12:00:27 +0800 Subject: [PATCH] fix: use useClass instead of useFactory for RESULT_PROJECTORS multi-provider The useFactory pattern returned the SyntheticResultProjector object directly but NestJS multi-provider resolution didn't wrap it in an array, causing 'projectors is not iterable' in ProjectionExecutor. useClass is the standard NestJS pattern for registering a class as a multi-provider element. Also removed the redundant standalone SyntheticResultProjector provider since useClass handles instantiation internally. Co-Authored-By: Claude --- src/modules/ai-job/ai-job.module.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/ai-job/ai-job.module.ts b/src/modules/ai-job/ai-job.module.ts index 30ca8c5..108f818 100644 --- a/src/modules/ai-job/ai-job.module.ts +++ b/src/modules/ai-job/ai-job.module.ts @@ -30,8 +30,7 @@ import { SyntheticRegistrationService } from './synthetic-registration.service'; AiJobExecutionEngineImpl, ProjectionExecutor, SyntheticRegistrationService, - SyntheticResultProjector, - { provide: RESULT_PROJECTORS, useFactory: (p: SyntheticResultProjector) => p, inject: [SyntheticResultProjector], multi: true } as any, + { provide: RESULT_PROJECTORS, useClass: SyntheticResultProjector, multi: true } as any, { provide: AI_JOB_EXECUTION_ENGINE, useExisting: AiJobExecutionEngineImpl }, ], exports: [