question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[gRPC] Loader option causes ClientGrpc.getService fail

See original GitHub issue

https://github.com/nestjs/nest/blob/d0bd2f7b200ebae72b29bc6b5fc3d62db81cd8fc/packages/microservices/client/client-grpc.ts#L36

(node:1600) UnhandledPromiseRejectionWarning: TypeError: Channel options must be an object with string keys and integer or string values

The message is pretty clear on what causes it. Right now my workaround is removing loader attribute before passing it to the constructor.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
kamilmysliwieccommented, Sep 13, 2018

Thanks @dzzzzzy. Looks like only the Client throws an exception when loader option is passed. Just published 5.3.7 fix 😃

1reaction
dzzzzzycommented, Sep 13, 2018
@Client({
        transport: Transport.GRPC,
        options: {
            url: 'localhost:50051',
            package: 'notadd_module_user',
            protoPath: join(__dirname, './protobufs/user-module.proto'),
            loader: {
                arrays: true
            }
        }
    })
    public readonly userModuleClient: ClientGrpc;

same error:

Channel options must be an object with string keys and integer or string values

@kamilmysliwiec hello kamil, the loader options can not work on @Client with grpc, could you give me some help?

[System Information]
OS Version     : Linux 4.18
NodeJS Version : v10.7.0
YARN Version    : 1.9.4
[Nest Information]
microservices version : 5.3.6
graphql version       : 5.2.2
common version        : 5.3.6
core version          : 5.3.6
Read more comments on GitHub >

github_iconTop Results From Across the Web

Basics tutorial | Node
A basic tutorial introduction to gRPC in Node. Contents. Why use gRPC? Example code and setup; Defining the service; Loading service descriptors ...
Read more >
NestJS - Grpc client: RpcException from server is serialized ...
If anyone stumbles across this, It is now possible to add an error serializer when creating the ClientProxy like so:
Read more >
gRPC - Microservices | NestJS - A progressive Node.js ...
The gRPC transporter options object exposes the properties described below. ... Then we use the ClientGrpc object's getService() method to retrieve the ...
Read more >
API with NestJS #20. Communicating with microservices ...
We also want to use the package keyword with a name. We will later refer to it when setting up gRPC with NestJS....
Read more >
NestJS Microservices - 4 - Using gRPC - YouTube
gRPC TypeScript Generator: https://github.com/improbable-eng/ts-protoc-genProto Files: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found