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.

b is not a function :b({code:2,message:“Incomplete response”} for grpcwebtext, but ok for grpcweb

See original GitHub issue

Hello!

I am trying to create client for my python grpc server.

My server implements server-side streaming methods and unary calls. As follows from library documentation, if I need streaming, i should compile my proto files with mode=grpcwebtext option

But, I also have following unary call method with bytes field in request:

message SaveUserDocumentRequest {
    bytes content = 1;
}

message SaveUserDocumentResponse {
    string url = 1;
}

service MyService {
    rpc SaveUserDocument (SaveUserDocumentRequest) returns (SaveUserDocumentResponse);
}

Client code is:

uploadImage({ content }, callback) {
        try {
            let realRequest = new SaveUserDocumentRequest();
            realRequest.setContent(content)

            this.client.saveUserDocument(realRequest, {}, (err, response) => {
                if(err) {
                    console.log(err)
                    return;
                }
                callback(response)
            })

        } catch(e) {
            console.log(e)
        }
    }

if I compile my protofiles with option mode=grpcweb this rpc method works just fine (but other server-streaming methods don’t)

But if I compile my protofiles with option mode=grpcwebtext and trying to use this method, i got following exception:

b is not a function :b({code:2,message:“Incomplete response”}

Please, if you know, what am I doing wrong, let me know Thanks for your help!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
yakovdomcommented, Aug 22, 2022

Thanks for your help! Somehow, after some iterations of development I can’t reproduce this issue any more. The sad thing is that I haven’t notice, what have I change to fix it:( But now all works just fine! So thank you very much!

0reactions
sampajanocommented, Aug 22, 2022

Oh ok… 😅 In any case, glad it works for you now! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to decrypt grpc-web-text ? · Issue #634 - GitHub
[problem] I send a grpc-web-text to server successfully, but payload ... b is not a function :b({code:2,message:“Incomplete response”} for ...
Read more >
index.js - Bundle Scanner
The parts of the code that are highlighted in grey are tokens that can be found in both places. Click on a token...
Read more >
b({code:2,message:“Incomplete response”} for grpcwebtext ...
Hello! I am trying to create client for my python grpc server. My server implements server-side streaming methods and unary calls.
Read more >
Grpc Grpc-Web Issues - IssueHint
b is not a function :b({code:2,message:“Incomplete response”} for grpcwebtext, but ok for grpcweb, closed, 7 ; Introducing new Enum value doesn't result in ......
Read more >
grpc grpc-web Issues - Giters
b is not a function :b({code:2,message:“Incomplete response”} for grpcwebtext, but ok for grpcweb. Closed 4 months ago 7 ...
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