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.

Response deserialize error

See original GitHub issue

Hi, We are trying to use streams with a net core backend but getting deserialize error

    "method":string"###"
    "error":{2 items
    "code":int2
    "message":string"Error in response deserializer function."
  }
}

protoc is version 3.14.0 grpc-web-gen is 1.2.1

command to generate the client is: protoc -I=./protos ./protos/*.proto --js_out=import_style=commonjs,binary:./dist --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:./dist

We successfully connect to the endpoint and retrieve the data and the call fails on tying to use response.getMessage() Since there is no other error message and debugging is not very straightforward any insight on what could cause this error would be welcome 😃

thank you

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
ghostcommented, Mar 3, 2021

I got the same error with gRPC Web because I copied the example without realizing getMessage() was not part of the framework API, but a message string field in the example Protobuf definition.

Try using response directly (or serializing it with toObject())

var stream = echoService.serverStreamingEcho(streamRequest, metadata);
stream.on('data', function(response) {
  console.log(response.toObject());
});
2reactions
robcecilcommented, Jan 24, 2021

@JuliusKoronci I got the same issue. Downgrade the Protoc compiler to the release version before the latest of the grpc-web can solves your problem.

This fixed the issue for me. Downgraded to 3.13.0, which was released before protoc-gen-grpc 1.2.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error deserializing a JSON response - MSDN - Microsoft
g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized...
Read more >
"Could not deserialize service response" error when ...
The issue is caused if the environment is not properly configured to host Sitefinity projects. ... The issue is caused by an incorrect...
Read more >
deserialize json into my C# object gives error - Stack Overflow
I get such JSON and want to deserialize it into my C# object. But this ends up in an error that cannot deserialize....
Read more >
REST API error handling in C# : GameSparks
The problem is that I have to use a library to deserialize the json response from string to a class. I would like...
Read more >
Partial deserialize JSON - OutSystems
The error says "Failed to deserialize JSON to BatchResponses_All: Unexpected character encountered while parsing value: {. Path 'responses' ...
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