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

allow turning off tonic_build transport feature for wasm target alone #1538

Open
borngraced opened this issue Sep 28, 2023 · 5 comments
Open

Comments

@borngraced
Copy link

this would be useful for using tonic with WASM

@borngraced borngraced changed the title allow turning off tonic transport feature for wasm target allow turning off tonic transport feature for wasm target alone Sep 28, 2023
@borngraced borngraced changed the title allow turning off tonic transport feature for wasm target alone allow turning off tonic_build transport feature for wasm target alone Sep 28, 2023
@tbmreza
Copy link

tbmreza commented Apr 11, 2024

Is this issue still relevant? Is using tonic while targeting wasm possible today?

@borngraced
Copy link
Author

borngraced commented Apr 11, 2024

I disabled transport feature and implemented in my code no need to rely on tonic_build for it

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tonic = { version = "0.7", features = ["tls", "tls-webpki-roots", "compression"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
tonic = { version = "0.7", default-features = false, features = ["prost", "codegen", "compression"] }

[build-dependencies]
tonic-build = { version = "0.7", default-features = false, features = ["prost", "compression"] }

@tbmreza
Copy link

tbmreza commented Apr 11, 2024

@borngraced Great that it works for you. I still have the problem, but thanks for the idea. 😀

@borngraced
Copy link
Author

What's the problem?..be specific please

@tbmreza
Copy link

tbmreza commented Apr 12, 2024

It's a runtime error (cargo c and cargo build are green using your config values) that I haven't figured out what the cause is. I have tried dioxus and trunk, same results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants