Closed VincentSurelle closed 5 years ago
It works with "@grpc/proto-loader": "^0.3.0"
Equally if you take the sample project: https://github.com/nestjs/nest/tree/master/sample/04-grpc
It has errors when running:
[Nest] 62903 - 2019-1-26 17:43:57 [Server] grpcPackage.loadPackageDefinition is not a function +14ms
Error: The invalid .proto definition (file not found)
If you upgrade all the packages to latest versions:
{
"name": "nest-typescript-starter",
"version": "1.0.0",
"description": "Nest TypeScript starter repository",
"license": "MIT",
"scripts": {
"start": "ts-node src/main.ts",
"prestart:prod": "tsc",
"start:prod": "node dist/main.js"
},
"dependencies": {
"@grpc/proto-loader": "^0.4.0",
"@nestjs/common": "^5.3.7",
"@nestjs/core": "^5.3.7",
"@nestjs/microservices": "^5.3.7",
"@nestjs/testing": "^5.3.7",
"@nestjs/websockets": "^5.3.7",
"class-transformer": "^0.1.7",
"class-validator": "^0.7.2",
"grpc": "^1.10.0",
"reflect-metadata": "^0.1.12",
"rxjs": "^6.1.0",
"typescript": "^2.8.0"
},
"devDependencies": {
"@types/node": "^7.0.41",
"ts-node": "^6.0.0",
"tslint": "^5.9.1"
}
}
you get the same error:
(node:44151) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'service' of null
but downgrading proto-loader worked:
npm install @grpc/proto-loader@0.3.0
Fixed in 5.7.0
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.
Hi everyone ;)
I'm submitting a...
Current behavior
On gRPC microservice startup, Unhandled exception is thrown :
Expected behavior
Normal startup ? 😄
Minimal reproduction of the problem with instructions
Here is my main.ts :
And here is my .proto file :
Apparently, the problem come from this line (server-grpc.js) :
I tried to console.log some thing to help debugging :
What is the motivation / use case for changing the behavior?
Environment
Thanks for any help provided :)