diff --git a/lib/serve-static.providers.ts b/lib/serve-static.providers.ts index dd172416..96257d02 100644 --- a/lib/serve-static.providers.ts +++ b/lib/serve-static.providers.ts @@ -9,7 +9,7 @@ export const serveStaticProviders: Provider[] = [ { provide: AbstractLoader, useFactory: (httpAdapterHost: HttpAdapterHost) => { - if (!httpAdapterHost) { + if (!httpAdapterHost || !httpAdapterHost.httpAdapter) { return new NoopLoader(); } const httpAdapter = httpAdapterHost.httpAdapter;