I am trying to set-up the GRPC React.js client with Ruby server. I have tested the server with simple Ruby client and it worked so moved on and tried to implement it in my React app, but I get an error TypeError: response.getMessage is not a function
when trying to get the message. I can see the requests correctly end up in the server and when I look at the response
itself it looks like it holds the value I expect (Hello
). What could be the problem?
# my_component.js
componentDidMount() {
const request = new Point()
request.setSensorId(1)
request.setDays(7)
this.client.getHistoricalData(request, {}, (err, response) => {
if (err) {
console.log(
`Unexpected error for sayHello: code = ${err.code}` +
`, message = "${err.message}"`
)
} else {
console.log(response)
console.log(response.getMessage())
}
})
}
# response
{
"wrappers_": null,
"arrayIndexOffset_": -1,
"array": [
"Hello"
],
"pivot_": 1.7976931348623157e+308,
"convertedPrimitiveFields_": {}
}