When attemping to build some web app with actix-web
, I ran into this issue:
|
|
This happens when I'm trying to utilize FramedRead
in Tokio in order to stream the content while sending it in acitx-web (instead of reading them all into memory before sending it out). As it turned out, this is due to a mismatch in version of the crate bytes
.
As the time of this writing, the latest version for actix-web
is 3.3.2, and the latest version for tokio
is 1.0. Naturally, I add the latest version of both in Cargo.toml
. However, since tokio 1.0 is released after actix-web 3.3.2, actix-web is still using an older version of tokio, resulting an older version of bytes. So, sadly there's a mismatch between the bytes crate used in the two components, and it happens to be the case that these two version are not compatible, and thus such error appears.
Fixing this issue is trivial. Simply use a matching version of tokio (here, it should be tokio 0.2.23). cargo tree | grep -z $CRATE
is very useful here.