-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing annotation import on gRPC service definition #844
Comments
The import statement is also missing in the golden file as shown in the snippet below: protobuf.dart/protoc_plugin/test/goldens/grpc_service.pbgrpc Lines 1 to 22 in a9bf79f
|
cc @osa1 |
Facing the same issue, while following observable flutter: grpc with @craiglabenz and @gianfrancopapa awesome content btw https://www.youtube.com/live/jCbclWBV32o?feature=share. To finish coding along I commented out the problem area as shown below as I noticed that piece of code didn't show up while @gianfrancopapa was coding in the protos/lib/src/generated/todo.pbgrpc.dart file.
Below is my protos/protos/todo.proto file.
Below is my protos/pubspec.yaml file.
Despite this, I was able to complete and test the rpc on windows and it works! The only issue is I couldn't access Todo parameters while implementing the rpc methods in the server/lib/todo_service.dart file below.
|
Thanks for reporting this. We've released protoc_plugin-21.0.1 with the fix. |
I still do encounter that issue. I am not too deep into that topic but wasn't |
I just released 21.0.1 an hour ago. If you're using 21.0.1 and the issue persists could you share your proto/grpc files so that I can take a look? |
I installed
|
You need protobuf-3.0.0 or newer for |
Cannot use |
We will release a new grpc soon with protobuf-3.0.0 support. (cc @sigurdm) |
OK. By soon you mean in the next few hours (in which case I will just take a break)? Or in the next few days, weeks, ... in which case I will revert to previous versions. |
Probably in the next few days. |
Release 21.0.0 of protoc_plugin generates
pbgrpc.dart
files in which the annotation@$pb.GrcpServiceName
is used to wrap the class implementing the RPC service, but that annotation is not imported in any way, resulting in code that cannot compile.To reproduce the issue:
hello.proto
pubspec.yaml
dart pub global activate protoc_plugin cd hello/ protoc --proto_path=. --dart_out=grpc:lib/ ./hello.proto
The output
hello.pbgrpc.dart
file will look like:The text was updated successfully, but these errors were encountered: