Grpc-web: npm/commonjs, where to find protoc-gen-grpc-web?

Created on 8 Aug 2018  路  4Comments  路  Source: grpc/grpc-web

Hi! I've been following the recent conversation and am glad to see support already merged. Great work!

I followed the quickstart in the module's readme, but I can't seem to find how to reference the protoc-gen-grpc-web plugin.

If I just run the example

protoc echo.proto --js_out=import_style=commonjs:generated --grpc-web_out=import_style=commonjs,mode=grpcweb,out=echo_grpc_pb.js:generated

It complains that "protoc-gen-grpc-web: program not found or is not executable".

Where can I get this plugin from? Do I have to compile it myself? Could it be included in the npm package?

Most helpful comment

I've been facing this in some projects recently.
Having to install and make stuff is not very developer friendly and might lead to "it works on my machine" issues...

So, until there is an npm package for this, I've created https://github.com/juanjoDiaz/grpc-web-generator which essentially only requires docker in the machine and can be integrated easily with npm-based workflows.

I think that it might be useful for someone getting to this issue 馃檪

All 4 comments

For now, you have to compile it yourself.

$ make plugin

We should add this to documentation though. We will certainly be looking to package this somehow in the near future.

Actually, looks like you are coming from the documentation from the npmjs website. Then you actually have to git clone this repository to get the code. The make plugin command I mentioned earlier was from this repository's root directory.

Sorry it wasn't very user friendly for now. We are working to polish on a lot of these fronts.

Alright, thanks for the quick reply. I understand that this is still a beta version :)

Building the plugin seems to work pretty easily. I added a line to the readme: #233

I've been facing this in some projects recently.
Having to install and make stuff is not very developer friendly and might lead to "it works on my machine" issues...

So, until there is an npm package for this, I've created https://github.com/juanjoDiaz/grpc-web-generator which essentially only requires docker in the machine and can be integrated easily with npm-based workflows.

I think that it might be useful for someone getting to this issue 馃檪

Was this page helpful?
0 / 5 - 0 ratings

Related issues

verihelp-vaibhav picture verihelp-vaibhav  路  5Comments

TBoshoven picture TBoshoven  路  4Comments

pumano picture pumano  路  6Comments

JuliusKoronci picture JuliusKoronci  路  4Comments

peteringram0 picture peteringram0  路  5Comments