TypeError: b is not a function. (In 'b(null, d)', 'b' is undefined)
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 802
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 5
Description
Hi 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. (index.js:60)
at yc (index.js:53)
at S. (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)
```
Contributor guide
Assessment
This issue has not been assessed yet.