Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer reported sdk does not work in Cloudflare workers #62

Open
eaddingtonwhite opened this issue Jul 15, 2022 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@eaddingtonwhite
Copy link
Member

A customer reported the following error when trying to use our SDK from cloudflare workers.
“socket2 does not support WASI・・・”

We would like to be supported on Cloudflare workers ideally we need to look into what we can do about this.

@eaddingtonwhite eaddingtonwhite added the bug Something isn't working label Jul 15, 2022
@jeastham1993
Copy link

jeastham1993 commented Nov 12, 2024

I've been chatting to Allen Helton about this, thought I'd add some additional context from a little bit of exploration I've done this morning, sorry if there's anything here you all already know :)

My working assumption is that the issue comes from using Tonic, well gRPC in general. Under the hood the way the Tonic client works isn't compatible with running 'in a browser', which is in essence what Wasm is. When you try and compile the code targetting WASM, you get compile errors related to Socket configuration.

There is a crate that supports generating a WASM compatible Tonic client and it looks like it is maintained. That said, I think the actual code changes would need to be in the client-protos library, as this is where all the Tonic client code is generated. I've had a quick look, but my knowledge kind of falls down at this point in terms of how the tonic builder works and if there would be a way to generate all the clients from Proto files in a WASM friendly way.

Hope that helps, @me if you have any follow up questions.

EDIT: Discovered that there is some work ongoing inside Tonic to that will help support this - hyperium/tonic#1594

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants