wasm-pack icon indicating copy to clipboard operation
wasm-pack copied to clipboard

`cargo metadata` exited with an error: error: failed to parse manifest at `/path/to/Cargo.toml`: feature `edition2024` is required

Open CBenoit opened this issue 9 months ago • 5 comments

Some of our dependencies are now using Rust edition 2024, and thus we had to bump the Rust toolchain in our workspace too.

However, it’s now impossible to use wasm-pack to target WASM, as it exits with this error:

Error: `cargo metadata` exited with an error: error: failed to parse manifest at `REDACTED`

Caused by:
  feature `edition2024` is required

  The package requires the Cargo feature called `edition2024`, but that feature is not stabilized in this version of Cargo (1.84.1 (66221abde 2024-11-19)).
  Consider trying a newer version of Cargo (this may require the nightly release).
  See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#edition-2024 for more information about the status of this feature.

I assume something must be updated in wasm-pack?

CBenoit avatar Mar 28 '25 20:03 CBenoit

I've also met this issue. The best way to fix thi issue is that verion down of rustc

whisdev avatar Apr 03 '25 18:04 whisdev

Image

whisdev avatar Apr 03 '25 18:04 whisdev

where able to solve this issue?

PritamP20 avatar Apr 06 '25 08:04 PritamP20

First, install dependencies with the command of cargo add then drop here screenshot of issues

whisdev avatar Apr 06 '25 09:04 whisdev

The 2024 edition has been stabilized in the 1.85 release use command rustup update to update to the latest version you can check the version with rustc --version && cargo --version

X9Z0 avatar Jul 17 '25 19:07 X9Z0