question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

helloworld example serializeBinary is not a function

See original GitHub issue

I think this is the same issue as #377 but no solution has been provided there. Any advice is appreciated.

What I did

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

What I expected

I expected the code to at least fail to connect to the server or function properly.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

6reactions
kibala145commented, Jun 3, 2020

It still doesn’t seem to be working without using binary option. (Release 1.1.0)

4reactions
adamkewleycommented, Jun 4, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

serializeBinary() not found using google-protobuf on nodejs
I get a Type Error saying that serializeBinary is not a function. Is there a different function, or something I am missing? I...
Read more >
NodeJS and Protobuf 3
var bytes = pbmessage.serializeBinary();. console.log('Serialized-Bytes : ' + bytes);. // Test pbmessge decode. var decodedmsg = proto.helloworld.
Read more >
grpc - Bountysource
I run grpc-web example: hello world in react native android. Then I got http response at 400 or 500 level, no problem in...
Read more >
Append rows with a static protocol buffer | BigQuery
This sample demonstrates how to use a protocol buffer to write data into a BigQuery table. ... async function appendRowsProto2() {
Read more >
Protocol Buffer Basics: Python - Google Developers
This isn't a comprehensive guide to using protocol buffers in Python. ... The example code is included in the source code package, under...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found