dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

build error: no method named `is_empty` found for struct `UnboundedSender` in the current scope

Open dan-arnold opened this issue 1 year ago • 2 comments

Problem

UnboundedSender::is_empty is only present in >= futures-channel-0.3.29, but is used by dioxus-core despite dioxus only depending on futures-channel-0.3.21.

If dioxus is used as a dependency in another project that resolves the futures-channel dependency to a version < 0.3.29, this causes a build failure:

error[E0599]: no method named `is_empty` found for struct `UnboundedSender` in the current scope
  --> [snip]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dioxus-core-0.6.0-alpha.2/src/reactive_context.rs:65:20
   |
65 |             if !tx.is_empty() {
   |                    ^^^^^^^^ method not found in `UnboundedSender<_>`

Steps To Reproduce

Steps to reproduce the behavior:

  • Change the futures-channel dependency version to 0.28.0 (emulating a project that has other dependencies that end up resolving the futures-channel dependency to version 0.28.0 of the package)
  • $ cargo build

Expected behavior

  • build should succeed

Environment:

  • Dioxus version: main
  • Rust version: 1.81.0
  • OS info: GNU/Linux 6.6.51 (Gentoo)
  • App platform: desktop

Questionnaire

  • [ ] I'm interested in fixing this myself but don't know where to start
  • [x] I would like to fix and I have a solution
  • [ ] I don't have time to fix this right now, but maybe later

dan-arnold avatar Oct 14 '24 02:10 dan-arnold

I tried bumping to the latest version of futures-channel, 0.31.0, ran all the tests described in the contribution guide, and everything builds successfully and passes. I can make a PR if you'd like.

dan-arnold avatar Oct 14 '24 02:10 dan-arnold

I tried bumping to the latest version of futures-channel, 0.31.0, ran all the tests described in the contribution guide, and everything builds successfully and passes. I can make a PR if you'd like.

That would be great!

ealmloff avatar Oct 14 '24 13:10 ealmloff