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] Error: The includeDirs option must be an array

See original GitHub issue

When 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/
	at KZe (/Users/
	at Eae.process (/Users/
	at runMicrotasks (<anonymous>)
	at processTicksAndRejections (internal/process/task_queues.js:93:5)
	at async Iq.trigger (/Users/
	at async Vp (/Users/
	at async Lw (/Users/
	at async zst (/Users/
	at async Object.iP (/Users/

This is an example of what I’m using:

proto < /Users/
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:closed
  • Created 2 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

AnWebercommented, Oct 4, 2021

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.

proto < /Users/
enums: String,
includeDirs: [ `${assetsDir}proto/third_party/googleapis` ],
AnWebercommented, Oct 2, 2021

I have now published the changes with version 4.1.0. Please test again and let me know. Thanks.

Read more comments on GitHub >

github_iconTop 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 >

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 Post

No results found

github_iconTop Related Hashnode Post

No results found