Problem description
I can not generate typescript types.
Dependencies
"@grpc/grpc-js": "^1.14.4",
"@grpc/proto-loader": "^0.8.1",
Proto files are located in the project root directory inside proto in the following structure:
proto/common/v1/common.proto
proto/user/v1/user.proto
proto/tag/v1/tag.proto
When I run the command by providing individual proto file through make command:
❯ @npx proto-loader-gen-types --longs=String --enums=String--defaults --oneofs --grpcLib=@grpc/grpc-js -I=./proto/ -O=src/lib/server/grpc/types/ user/v1/user.proto
It works and generates the necessary types in the desired directory.
However when I run this:
❯ @npx proto-loader-gen-types --longs=String --enums=String--defaults --oneofs --grpcLib=@grpc/grpc-js -I=./proto/ -O=src/lib/server/grpc/types/ **/**/*.proto
It does not work.
It does not work with */*/*.proto , *.proto , */*.proto .
I get the error when I try with various approaches of using *:
(node:9591) Warning: */*.proto not found in any of the include paths proto/
(Use `node --trace-warnings ...` to show where the warning was created)
[Error: ENOENT: no such file or directory, open '*/*.proto'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '*/*.proto'
}
make: *** [testss] Error 1
I also ran :
@npx proto-loader-gen-types --longs=String --enums=String--defaults --oneofs --grpcLib=@grpc/grpc-js -I=./proto/ -O=src/lib/server/grpc/types/ user/v1/*.proto
It doesn't work either. When I remove * and give the actual filename, it works however.
My assumption is that * is not being expanded at all.
Environment
OS name, version and architecture: MacOS Tahoe 26.6.2
Node version: v24.12.0
Npx Version: v11.6.2
Problem description
I can not generate typescript types.
Dependencies
"@grpc/grpc-js": "^1.14.4",
"@grpc/proto-loader": "^0.8.1",
Proto files are located in the project root directory inside
protoin the following structure:When I run the command by providing individual proto file through make command:
❯ @npx proto-loader-gen-types --longs=String --enums=String--defaults --oneofs --grpcLib=@grpc/grpc-js -I=./proto/ -O=src/lib/server/grpc/types/ user/v1/user.proto
It works and generates the necessary types in the desired directory.
However when I run this:
❯ @npx proto-loader-gen-types --longs=String --enums=String--defaults --oneofs --grpcLib=@grpc/grpc-js -I=./proto/ -O=src/lib/server/grpc/types/ **/**/*.proto
It does not work.
It does not work with
*/*/*.proto,*.proto,*/*.proto.I get the error when I try with various approaches of using *:
I also ran :
It doesn't work either. When I remove * and give the actual filename, it works however.
My assumption is that * is not being expanded at all.
Environment
OS name, version and architecture: MacOS Tahoe 26.6.2
Node version: v24.12.0
Npx Version: v11.6.2