Closed metapone closed 2 years ago
Thanks so much for bringing this up! Will check and get back! Thanks! :)
Found out more details :) This is actually an intentional change, as announced here: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#javascript
A new protoc binary will be provided separately at https://github.com/protocolbuffers/protobuf-javascript to provide --js_out
functionalities. It's not ready yet and i will update this thread when it is..
For now, please use the v3.20.1 (link) release of the protoc binary..
Thanks for your understanding! :)
A new separate JS compiler is now provided by protobuf-javascript: https://github.com/protocolbuffers/protobuf-javascript/releases
I'll update the documentations to point to it instead :)
You need to install protoc-gen-js globally to generate gRPC code in javascript using bellow command
npm install -g protoc-gen-js
Then, bellow command to generate gRPC code
protoc --js_out=import_style=commonjs,binary:. your_proto_file_name.proto
Using protoc v21.0 with grpc-web v1.3.1 will yield error "--js_out: options: mode is required". Downgrading to protoc v3.20.1 will temporarily solve this issue.
Here's my full protoc command:
protoc -I=./ Protos/test.proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=typescript,mode=grpcwebtext:.