Hi,

I have a service Foo defined like so:

syntax = "proto3";

import "google/protobuf/empty.proto";

service Foo {
  rpc Ping(google.protobuf.Empty) returns (Pong);
}

message Pong {
  bool alive = 1;
}

from which I codegen the JavaScript files I need to implement a client like 
this:

const google_protobuf_empty_pb = 
require('google-protobuf/google/protobuf/empty_pb.js');
const {SubscribeRequest,Offset} = require('./kafkaproxy_pb.js');
const {ProxyClient} = require('./kafkaproxy_grpc_web_pb.js');

var client = new ProxyClient('http://' + window.location.hostname + 
':9000', null, null);

client.ping(google_protobuf_empty_pb, {}, (err, response) => {
        console.log(response.getAlive());
});

I then `npx webpack` this script to build a `./dist/main.js` served from 
`index.html`.

My problem though is that the Ping RPC in my main.js does not resolve the 
type of the `request` correctly which results in:

[image: Screen Shot 2018-12-18 at 2.16.16 PM.png]


How do I use the google.protobuf.Empty type when making requests using 
grpc-web?

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/99b80848-453b-4440-9a18-15f2c063a85b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to