From b23af7a8739364a2c7f616f16a1583fda9eb9ecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Jane=C4=8Dek?= Date: Mon, 1 Aug 2022 14:31:35 +0200 Subject: [PATCH] fix(repl): use ApplicationContext for repl --- packages/core/repl/repl-context.ts | 4 ++-- packages/core/repl/repl.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/repl/repl-context.ts b/packages/core/repl/repl-context.ts index f8eef91a873..5201760cd4f 100644 --- a/packages/core/repl/repl-context.ts +++ b/packages/core/repl/repl-context.ts @@ -1,4 +1,4 @@ -import { INestApplication, InjectionToken, Logger } from '@nestjs/common'; +import { INestApplicationContext, InjectionToken, Logger } from '@nestjs/common'; import { ApplicationConfig } from '../application-config'; import { ModuleRef, NestContainer } from '../injector'; import { InternalCoreModule } from '../injector/internal-core-module'; @@ -33,7 +33,7 @@ export class ReplContext { private readonly container: NestContainer; constructor( - public readonly app: INestApplication, + public readonly app: INestApplicationContext, nativeFunctionsClassRefs?: ReplFunctionClass[], ) { this.container = (app as any).container; // Using `any` because `app.container` is not public. diff --git a/packages/core/repl/repl.ts b/packages/core/repl/repl.ts index 301a2fb5194..b3596d37666 100644 --- a/packages/core/repl/repl.ts +++ b/packages/core/repl/repl.ts @@ -7,8 +7,8 @@ import { ReplContext } from './repl-context'; import { ReplLogger } from './repl-logger'; import { AbstractHttpAdapter } from '../adapters/http-adapter'; -export async function repl(module: Type, httpAdapter?: AbstractHttpAdapter) { - const app = await NestFactory.create(module, httpAdapter, { +export async function repl(module: Type) { + const app = await NestFactory.createApplicationContext(module, { abortOnError: false, logger: new ReplLogger(), });