Reqwest breaks cargo when imported on nightly
⚓ Rust 📅 2026-02-07 👤 surdeus 👁️ 1I'm trying to use the nightly rust because of the per-package-target, tracked in this issue
Unfortunately, adding some packages break my current build.
My current setup is a crate without an explicit target which gets used in two other crates, one with a wasm forced-package target, and the other one without. Currently, the shared crate Cargo.toml looks like this:
[package]
name = "shared"
version = "0.1.0"
edition = "2024"
[dependencies]
serde = { workspace = true, features = ["derive"] }
url = { workspace = true, features = ["serde"] }
hmac-sha256 = "1.1.12"
tinyrand = "0.5.0"
which gets imported into frontend:
cargo-features = ["per-package-target"]
[package]
name = "frontend"
version = "0.1.0"
edition = "2024"
forced-target = "wasm32-wasip2"
[lib]
crate-type = ["cdylib"]
[dependencies]
console_error_panic_hook = "0.1.7"
shared = { version = "0.1.0", path = "../shared" }
wasm-bindgen = "0.2"
and cli:
[package]
name = "cli"
version = "0.1.0"
edition = "2024"
[dependencies]
...
shared = { version = "0.1.0", path = "../shared" }
...
The crate reqwest supports wasm targets, but once I add the the crate to shared and compile I get an error that looks like this:
thread 'main' (37473) panicked at src/tools/cargo/src/cargo/core/resolver/features.rs:325:13:
did not find features for (PackageId { name: "js-sys", version: "0.3.85", source: "registry `crates-io`" }, NormalOrDev) within activated_features:
[
(
PackageId {
name: "same-file",
version: "1.0.6",
source: "registry `crates-io`",
},
NormalOrDev,
),
// many other PackageIds here
]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Here is my cargo version output:
cargo 1.95.0-nightly (fe2f314ae 2026-01-30)
My question is: is this a bug? Should I report this to http://github.com/rust-lang/cargo/issues? Is there already an issues for this (I tried searching but any issue I could find by the keywords in the error seems unrelated)? Should I take any additional debug steps (apart from reverting to a stable version of cargo and enforcing per package target via my build scripting)
1 post - 1 participant
🏷️ Rust_feed