I think this is the same issue as #377 but no solution has been provided there. Any advice is appreciated.
I cloned the repository and and followed the instructions in the README. I executed
sudo mv ~/Downloads/protoc-gen-grpc-web-1.0.4-darwin-x86_64 /usr/local/bin/protoc-gen-grpc-web
chmod +x /usr/local/bin/protoc-gen-grpc-web
protoc -I=. helloworld.proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs,mode=grpcwebtext:.
npm install
npx webpack client.js
npx webpack client.js
and get the following error when loading the website
Uncaught TypeError: t.serializeBinary is not a function
at MethodInfo.a (main.js:8)
at we.N (main.js:8)
at n.helloworld.GreeterClient.sayHello (main.js:8)
at Object.<anonymous> (main.js:1)
at r (main.js:1)
at main.js:1
at main.js:1
I expected the code to at least fail to connect to the server or function properly.
@langep Have you run the gRPC backend server and the Envoy proxy?
@stanley-cheung Yes, I tried it while the gRPC backend server and Envoy proxy where running following the docs on how to start it on MacOS.
Try:
protoc -I=. helloworld.proto --js_out=import_style=commonjs,binary:. --grpc-web_out=import_style=commonjs,mode=grpcwebtext:.
Had a similar problem earlier today. For some reason, the protoc I'm using requires passing binary into --js_out
I had similar issue and using binary for --js_out options worked. Although I still don't fully understand what the issue was.
Sorry I am declaring Bug Bankruptcy on some of these older issues. If this is still reproducible with a newer release, please reopen a new issue.
It still doesn't seem to be working without using binary option. (Release 1.1.0)
Most helpful comment
Try:
Had a similar problem earlier today. For some reason, the
protocI'm using requires passingbinaryinto--js_out