TypeError: b is not a function. (In 'b(null, d)', 'b' is undefined)
See original GitHub issueHi there,
I’m having some issues invoking gRPC-web calls from my React application. Invoking my RPC works correctly and the server receives the request without issue, however an error appears in my console on every request.
index.js:60 Uncaught TypeError: b is not a function
at Array.<anonymous> (index.js:60)
at yc (index.js:53)
at S.<anonymous> (index.js:51)
at Ib (index.js:34)
at O (index.js:33)
at oc (index.js:42)
at S.push../node_modules/grpc-web/index.js.S.O (index.js:40)
at S.push../node_modules/grpc-web/index.js.S.K (index.js:40)
I’m running a gRPC server in Go with a React application communicating with the Go server via the Envoy proxy.
I compile my Proto using the following command:
protoc \
--js_out=import_style=commonjs,binary:web-client/src/ \
--grpc-web_out=import_style=commonjs,mode=grpcwebtext:web-client/src/ \
proto/myapp.proto
$ protoc --version
libprotoc 3.14.0
and I build my request from React like so:
const { GetMessagesRequest, Message } = require('../../proto/myapp_pb.js');
const { MyappClient } = require('../../proto/myapp_grpc_web_pb');
const myappService = new MyappClient('http://localhost:8080');
const msg = new Message()
const meta = {
"authorization": "fake_123456",
}
await myappService.broadcast(msg, meta)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
TypeError: b is undefined when appending - Stack Overflow
You call styleBox without setting this reference, you need to do styleBox.apply(this) $("#invite-emails").keypress(function(e){ if(e.which ...
Read more >Uncaught TypeError: 'undefined' is not a function
Uncaught TypeError: 'undefined' is not a function. This is a common JavaScript error that happens when you try to call a function before...
Read more >TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript TypeError: "x" is not a function occurs when calling a function on a value or object, which is not actually a...
Read more >The 10 Most Common JavaScript Issues Developers Face
Haskel: ``` add a b = a + b add5 = add 5 ``` JavaScript: ``` function add(a,b) { return a+b } var...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My coworker found the issue here - before, my call looked like this:
But now it needs to look like:
Hopefully this may help you as well.
@Enrikerf oh - I’m FAR from the right person to be asking, I do very little Javascript, not sure I can really help much 😃