Closed filtoid closed 1 year ago
Hi. I think you're creating a normal grpc server without adding support for grpc-web. You need to use tonic-web
to do this.
Here's an example for this: https://github.com/devashishdxt/tonic-web-wasm-client/tree/main/test-suite/simple/server
Ah, thanks I shall have a go at that then - I thought I might be doing something wrong.
Thanks in part to your linked suggestion I have realised that tonic-web doesn't work when NoCors is set on the client. I shall update the code with the fixed version and push.
I've put together a simple example of the problem I'm facing (which is probably user error, but I'm afraid I'm completely stumped as to what might be causing it). The example can be found here: https://github.com/filtoid/tonic-web-wasm-client-example
This sets up a simple server using Tonic and a simple front end in Yew, which uses
tonic-web-wasm-client
to make the request to the server. The response causes the library to throw the following error:Which appears to imply the server is not replying with a response, however from inspecting in the browser network tab it seems to show that it did succeed and returned a valid header for content-type (albeit not an accepted one, but I've tried forcing the content-type to the "accept"ed version and it still responded in this way. In Firefox it shows that no body was returned - however in Edge and Safari it shows a body:
Any advice you can give me on how to proceed would be very gratefully received but I've tried linking the lib locally and putting some tracer statements in, and the only thing I can see is what appears to be the response just being "lost" somehow, as the browser sees it but the library can not.