(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.
Could you share your entire loader options?
@kamilmysliwiec Sure, here it is
loader: {
includeDirs: [join(__dirname, process.env.PROTOS_PATH || '')]
}
Honestly, just tried your code and I cannot reproduce your issue. Do you use the latest version of the framework?
i have the same issue when set loader, solutions:
@kamilmysliwiec I did at the time. It was 5.2.2. I haven't tried again with the new version yet.
@nooop3 I need it because of the imports in protobuf files.
Problem still persists with version 5.3.6
@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
Hi guys,
I really need the whole repo with dir structure. I can't reproduce this issue without it
Hi guys,
I really need the whole repo with dir structure. I can't reproduce this issue without it
@kamilmysliwiec Here is the reproduce repo with nest sample-04-grpc https://github.com/dzzzzzy/nest/tree/master/sample/04-grpc
I do these changes:
core, common and microservice package to latest versiongrpc-client.options.ts such as:loader: {
arrays: true,
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
}
And then run npm start, this issues can reproduced.
Thanks @dzzzzzy. Looks like only the Client throws an exception when loader option is passed. Just published 5.3.7 fix :)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Thanks @dzzzzzy. Looks like only the Client throws an exception when
loaderoption is passed. Just published 5.3.7 fix :)