[gRPC] Error: The includeDirs option must be an array
See original GitHub issueWhen I try to use the includeDirs
option of @grpc/proto-loader I get the following error:
ERROR: ExecuteHook: protoImport failed
ERROR: Error - The includeDirs option must be an array
Error: The includeDirs option must be an array
at Object.IZe [as loadProtosWithOptions] (/Users/user.name/.vscode/extensions/anweber.vscode-httpyac-4.0.3/dist/extension.js:84:29203)
at KZe (/Users/user.name/.vscode/extensions/anweber.vscode-httpyac-4.0.3/dist/extension.js:84:31987)
at Eae.process (/Users/user.name/.vscode/extensions/anweber.vscode-httpyac-4.0.3/dist/extension.js:90:126676)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Iq.trigger (/Users/user.name/.vscode/extensions/anweber.vscode-httpyac-4.0.3/dist/extension.js:90:76164)
at async Vp (/Users/user.name/.vscode/extensions/anweber.vscode-httpyac-4.0.3/dist/extension.js:90:93948)
at async Lw (/Users/user.name/.vscode/extensions/anweber.vscode-httpyac-4.0.3/dist/extension.js:90:94554)
at async zst (/Users/user.name/.vscode/extensions/anweber.vscode-httpyac-4.0.3/dist/extension.js:90:101698)
at async Object.iP (/Users/user.name/.vscode/extensions/anweber.vscode-httpyac-4.0.3/dist/extension.js:90:101567)
This is an example of what I’m using:
proto < /Users/user.name/go/my-service/my-service.proto
enums: String,
includeDirs: [ "../../proto/third_party/googleapis" ],
###
GRPC http://localhost:9090/myservice.MyService/GetUser
{
"userId": "123456",
}
Is it something wrong with my .http
file?
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
GRPC client using with node js facing issue - Stack Overflow
I found the solution to the above error, you need to create a folder inside the project directory googleapis->google->api then need to add ......
Read more >GrpcClientOptions - google-gax documentation
... if (Array.isArray(filename) && filename.length === 0) { return {}; } const options = GrpcClient.defaultOptions(); options.includeDirs.unshift(protoPath) ...
Read more >@grpc/proto-loader - npm
Start using @grpc/proto-loader in your project by running `npm i ... includeDirs, An array of strings, A list of search paths for imported ......
Read more >How to use the protobufjs.Root function in protobufjs - Snyk
includeDirs ) { if (!Array.isArray(options.includeDirs)) { throw new Error('The includeDirs option must be an array'); } addIncludePathResolver(root, options ...
Read more >google-gax documentation - Google APIs
src/grpc.ts. Index. Properties. equals. Properties. equals. equals: Function. Type : Function. import * as grpcProtoLoader from '@grpc/proto-loader'; ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I read over the question:-) Yes it is possible, but in this case not by
{{...}}
but in template notation. The options are already executed as javascript.I have now published the changes with version 4.1.0. Please test again and let me know. Thanks.