If I run tsc -d on my Typescript source I get the following message:
../../../../../grpc/index.d.ts(69,50): error TS2314: Generic type 'Message<T>' requires 1 type argument(s).
grpc-node version: 1.9.0
Typescript version: 2.7.1
tsconfig.json compiler options:
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true
}
I have published version 1.9.1, which includes a fix for this issue.
I think this fix is wrong. node-grpc is using protobufjs ^5.0.0 as a dependency, and in this version of protobufjs's typings Message is not a generic class.
@murgatroid99 It seems this might still be an issue; tsc was failing for me until I installed v1.9.0 (pre your change mentioned above) and then it compiled fine.
Message: node_modules/grpc/index.d.ts(69,50): error TS2315: Type 'Message' is not generic.
@murgatroid99 I'm having the same issue with grpc version 1.11.3. I'm trying to use pbjs (protobufjs), but keep running into node_modules/grpc/index.d.ts(69,50): error TS2315: Type 'Message' is not generic.
@respinha-ribeiro Can you comment on which version of Protobuf.js type definitions you are using? The fix for this change seems to break other users.
@miv is right, this package use protobufjs 5 so you should import @types/protobufjs@^5.x.x in you project.
Most helpful comment
I have published version 1.9.1, which includes a fix for this issue.