[GH-ISSUE #87] rspotify fails to build with blocking feature #25

Closed
opened 2026-02-27 20:22:40 +03:00 by kerem · 3 comments
Owner

Originally created by @cosmoduff on GitHub (Mar 29, 2020).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/87

Reqwest has blocking set as an optional feature and is off by default. When trying to build rspotify with the blocking feature you get error messages similar to the following:

error[E0432]: unresolved import `reqwest::blocking`
 --> src/blocking/client.rs:5:14
  |
5 | use reqwest::blocking::Client;
  |              ^^^^^^^^ could not find `blocking` in `reqwest`

error[E0432]: unresolved import `reqwest::blocking`
 --> src/blocking/oauth2.rs:6:14
  |
6 | use reqwest::blocking::Client;
  |              ^^^^^^^^ could not find `blocking` in `reqwest`

error[E0433]: failed to resolve: could not find `blocking` in `reqwest`
  --> src/blocking/client.rs:65:21
   |
65 | impl From<&reqwest::blocking::Response> for ApiError {
   |                     ^^^^^^^^ could not find `blocking` in `reqwest`

error[E0433]: failed to resolve: could not find `blocking` in `reqwest`
  --> src/blocking/client.rs:66:33
   |
66 |     fn from(response: &reqwest::blocking::Response) -> Self {
   |                                 ^^^^^^^^ could not find `blocking` in `reqwest`

error[E0599]: no method named `request` found for type `blocking::client::CLIENT` in the current scope
   --> src/blocking/client.rs:153:34
    |
38  | / lazy_static! {
39  | |     /// HTTP Client
40  | |     pub static ref CLIENT: Client = Client::new();
41  | | }
    | |_- method `request` not found for this
...
153 |               let builder = CLIENT.request(method, &url.into_owned()).headers(headers);
    |                                    ^^^^^^^ method not found in `blocking::client::CLIENT`
    |
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

Originally created by @cosmoduff on GitHub (Mar 29, 2020). Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/87 Reqwest has blocking set as an optional feature and is off by default. When trying to build rspotify with the blocking feature you get error messages similar to the following: ``` error[E0432]: unresolved import `reqwest::blocking` --> src/blocking/client.rs:5:14 | 5 | use reqwest::blocking::Client; | ^^^^^^^^ could not find `blocking` in `reqwest` error[E0432]: unresolved import `reqwest::blocking` --> src/blocking/oauth2.rs:6:14 | 6 | use reqwest::blocking::Client; | ^^^^^^^^ could not find `blocking` in `reqwest` error[E0433]: failed to resolve: could not find `blocking` in `reqwest` --> src/blocking/client.rs:65:21 | 65 | impl From<&reqwest::blocking::Response> for ApiError { | ^^^^^^^^ could not find `blocking` in `reqwest` error[E0433]: failed to resolve: could not find `blocking` in `reqwest` --> src/blocking/client.rs:66:33 | 66 | fn from(response: &reqwest::blocking::Response) -> Self { | ^^^^^^^^ could not find `blocking` in `reqwest` error[E0599]: no method named `request` found for type `blocking::client::CLIENT` in the current scope --> src/blocking/client.rs:153:34 | 38 | / lazy_static! { 39 | | /// HTTP Client 40 | | pub static ref CLIENT: Client = Client::new(); 41 | | } | |_- method `request` not found for this ... 153 | let builder = CLIENT.request(method, &url.into_owned()).headers(headers); | ^^^^^^^ method not found in `blocking::client::CLIENT` | = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) ```
kerem closed this issue 2026-02-27 20:22:40 +03:00
Author
Owner

@sputnick1124 commented on GitHub (Apr 24, 2020):

What git-sha are you trying to build? What version of rust?
Currently the master branch (github.com/ramsayleung/rspotify@96fe932724) builds for me with cargo build --features=blocking.

$ rustc --version
rustc 1.42.0 (b8cedc004 2020-03-09)
<!-- gh-comment-id:619200765 --> @sputnick1124 commented on GitHub (Apr 24, 2020): What git-sha are you trying to build? What version of rust? Currently the master branch (https://github.com/ramsayleung/rspotify/commit/96fe932724c48e47ba8831790f43aacc405a5a36) builds for me with `cargo build --features=blocking`. ```bash $ rustc --version rustc 1.42.0 (b8cedc004 2020-03-09) ```
Author
Owner

@cosmoduff commented on GitHub (Apr 24, 2020):

This was fixed by pull #88 and can be closed.

<!-- gh-comment-id:619205032 --> @cosmoduff commented on GitHub (Apr 24, 2020): This was fixed by pull #88 and can be closed.
Author
Owner

@ramsayleung commented on GitHub (Apr 25, 2020):

Yes, @cosmoduff is right, this problem was fixed :)

<!-- gh-comment-id:619308621 --> @ramsayleung commented on GitHub (Apr 25, 2020): Yes, @cosmoduff is right, this problem was fixed :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#25
No description provided.