Skip to content

Failed to generate pb file when using proto3 version. #1717

@zhushenhang

Description

@zhushenhang

Problem description

Failed to generate pb file when using proto3 version.
UHDInterface.proto: is a proto3 file that contains optional fields, but code generator protoc-gen-grpc hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.--grpc_out

Reproduction steps

  1. I yarn add grpc-tools
  2. cmd command: protoc --js_out=import_style=commonjs,binary:./ --plugin=protoc-gen-grpc=./grpc_node_plugin.exe --grpc_out=./ UHDInterface.proto
  3. Finally reported an error

Environment

  • OS name, version and architecture: Windows 10
  • Node version v14.15.1
  • Node installation method msi
  • If applicable, compiler version [e.g. clang 3.8.0-2ubuntu4]
  • Package name and version grpc-tools ^1.10.0

Additional context

I used grpc to build the client and server for the first time and learned the official example. I see the following two files: helloworld_pb and helloworld_grpc_pb.I did not find an official example of generating these two files. I found other information. I would like to ask, how do we generally generate these two files now?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions