'Protoc does not export grpc-web files [MacOS]
I have a simple proto file:
syntax = "proto3";
package SettingsSvc;
service Settings {
rpc FetchSettings(SettingsRequest) returns (SettingsResponse) {}
}
message SettingsRequest {
string language = 1;
}
message SettingsResponse {
string cvTooltip = 1;
string themeTooltip = 2;
string githubLocation = 3;
string gitlabLocation = 4;
string linkedinLocation = 5;
string name = 6;
int32 year = 7;
}
And I am trying to generate the files for a react (TS template) web client. As suggested by the official grpc-web page I am running the protoc command as follows:
protoc -I=. settings.proto --js_out=import_style=commonjs,binary:. --grpc-web_out=import_style=typescript,mode=grpcweb:.
However, the only file I get is settings_pb.js, which is the one generated by the --js_out instruction. The file that should be generated by the --grpc-web_out instruction (SettingsClientPb.ts) is missing.
I tried using import_style=commonjs and import_style=commonjs+dts as well, but no luck. The command returns no errors but it does not produce the expected output files.
I installed protoc with brew and I am using version 1.3.1 of the grpc-web code generator plugin.
I couldn't find any mention of bugs and my command line instruction seems right to me.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
