Closed Emulator000 closed 1 day ago
just ran into this myself, the problem is (noted by another user in #1636) that the version of tower-http
that tonic-web
is using is 0.4.4
as of the latest published release (0.11.0
), so you need to manually downgrade the tower-http
version in your crate to match that 0.4.4
version, which will then compile. it fails because of the major version mismatch which means there's two Service
traits (one from the tower-http
you have as a dependency, and one from the version of tower-http
that tonic-web
has as a dependency) which means its not implemented for the one you need.
Bug Report
Version
Platform
Linux
Crates
tonic-web
Description
I'm trying to use gRPC-web example provided here but I'm getting a CORS error into the browser during the API call:![image](https://github.com/hyperium/tonic/assets/15048541/d2c6070d-000c-481d-9980-e61a451510bf)
I resolved in the past this problem with this modified example configuration:
but within the new version I'm getting this compiler error:
so I can't use it anymore and I've to relay entirely into the
tonic_web::enable
feature that is designed for the gRPC-web CORS problem.