juanjoDiaz/grpc-web-generator

Can't generate the js from proto file

Closed this issue · 6 comments

Hey !

I was following your tutorial (README) however I am suck..

https://github.com/juanjoDiaz/grpc-web-generator#generating-the-files

I tried but I got that:

MacBook-Pro-de-Emixam23:src emixam23$ docker run -v "protofile:/protofile" -e "/Users/emixam23/<.........>/src/protofile=api_administration_service.proto" juanjodiaz/grpc-web-generator
/protofile/echo.proto: No such file or directory

Even if I think I am probably wrong at some point, I don't get the echo.proto part, I mean I set the file name so why do I get this one?

Thanks !

Hi @Emixam23,

-e "/Users/emixam23/<.........>/src/protofile=api_administration_service.proto" is wrong.
You want it to be -e "protofile=api_administration_service.proto".

-v "protofile:/protofile" assumes that there is a folder in your project called protofile
-e "protofile=api_administration_service.proto" declared that the protofile inside your protofile folder is called api_administration_service.proto so that file should be there.

The output should be at /protofile/generated/

Hope this helps!
Let me know if I can help you further.

Hey :) Thanks for your help.

MacBook-Pro-de-Emixam23:src emixam23$ docker run -v "protofile:/protofile" -e "protofile=api_administration_service.proto" juanjodiaz/grpc-web-generator
/protofile/api_administration_service.proto: No such file or directory
MacBook-Pro-de-Emixam23:src emixam23$ ls
App.css          App.js           App.test.js      api_stub         components       containers       index.css        index.js         logo.svg         proto            protofile        reducers         serviceWorker.js
MacBook-Pro-de-Emixam23:src emixam23$

I tried to change the -e option because I was getting this error at first

Is the api_administration_service.proto file inside the protofile folder?

Docker volumes don't work well with relative paths.
So please try: docker run -v "${PWD}/protofile:/protofile" -e "protofile=api_administration_service.proto" juanjodiaz/grpc-web-generator

${PWD} should be your absolute path/Users/emixam23/<.........>/src.
You can also just put the absolute path but ${PWD} is probably more portable.

Did that help @Emixam23 ?

Hey !

I couldn't check yet but I will try to come back to you as soon as I tried :)

Best,

I assume that this was resolved?

Closing for now.
Feel free to reopen if needed.