diff --git a/lib/conditional.module.ts b/lib/conditional.module.ts index f7d70545..9e8d8af9 100644 --- a/lib/conditional.module.ts +++ b/lib/conditional.module.ts @@ -14,11 +14,14 @@ export class ConditionalModule { options?: { timeout: number }, ) { const { timeout = 5000 } = options ?? {}; + const timer = setTimeout(() => { throw new Error( `Nest was not able to resolve the config variables within ${timeout} milliseconds. Bause of this, the ConditionalModule was not able to determine if ${module.toString()} should be registered or not`, ); }, timeout); + timer.unref(); + const returnModule: Required< Pick > = { module: ConditionalModule, imports: [], exports: [] };