From 36e8bfca81108025f0ab2ee40a43876472eae585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20My=C5=9Bliwiec?= Date: Wed, 22 Mar 2023 09:46:33 +0100 Subject: [PATCH] fix(core): circular structure error (jest) #11303 --- .../core/errors/exceptions/unknown-dependencies.exception.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/errors/exceptions/unknown-dependencies.exception.ts b/packages/core/errors/exceptions/unknown-dependencies.exception.ts index 3fc7457bcc2..57c7207c839 100644 --- a/packages/core/errors/exceptions/unknown-dependencies.exception.ts +++ b/packages/core/errors/exceptions/unknown-dependencies.exception.ts @@ -4,12 +4,15 @@ import { UNKNOWN_DEPENDENCIES_MESSAGE } from '../messages'; import { RuntimeException } from './runtime.exception'; export class UnknownDependenciesException extends RuntimeException { + public readonly moduleRef: { id: string } | undefined; + constructor( public readonly type: string | symbol, public readonly context: InjectorDependencyContext, - public readonly moduleRef?: Module, + moduleRef?: Module, public readonly metadata?: { id: string }, ) { super(UNKNOWN_DEPENDENCIES_MESSAGE(type, context, moduleRef)); + this.moduleRef = moduleRef && { id: moduleRef.id }; } }