Skip to content

Commit 4b6ca2a

Browse files
bugfix(microservices) fix client with loader settings
1 parent 137e8fd commit 4b6ca2a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/microservices/client/client-grpc.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Logger } from '@nestjs/common/services/logger.service';
22
import { loadPackage } from '@nestjs/common/utils/load-package.util';
3+
import { isObject } from '@nestjs/common/utils/shared.utils';
34
import { Observable } from 'rxjs';
45
import { GRPC_DEFAULT_URL } from '../constants';
56
import { InvalidGrpcPackageException } from '../exceptions/errors/invalid-grpc-package.exception';
@@ -32,7 +33,10 @@ export class ClientGrpcProxy extends ClientProxy implements ClientGrpc {
3233
}
3334

3435
public getService<T extends {}>(name: string): T {
35-
const options = this.options as any;
36+
const options: any = isObject(this.options)
37+
? { ...this.options, loader: '' }
38+
: {};
39+
3640
if (!this.grpcClient[name]) {
3741
throw new InvalidGrpcServiceException();
3842
}

0 commit comments

Comments
 (0)