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

New project from `wasm-pack new` fails to build with wgpu, needs edition or resolve change in Cargo.toml

Open ahupp opened this issue 2 years ago • 1 comments

🐛 Bug description

If I create a new project with wasm-pack new, and add wgpu as a dependency it fails to build. Adding resolver = "2", or "edition = "2021" (which implies the resolver = "2") to Cargo.toml fixes it. I'm not sure if this is a wasm-pack issue or a wgpu issue.

🤔 Expected Behavior

It should build without errors.

👟 Steps to reproduce

$ wasm-pack new test-wgpu
$ cd test-wgpu
$ cargo add --features webgl wgpu 
    Updating crates.io index
      Adding wgpu v0.15.1 to dependencies.
...
$ wasm-pack build
... fails..

Full build output

🌍 Your environment

nment. wasm-pack version: wasm-pack 0.11.0 rustc version: rustc 1.68.2 (9eb3afe9e 2023-03-27)

ahupp avatar Mar 28 '23 21:03 ahupp

Looks like this is documented in the wgpu tutorial, but it would be less surprising if the generated project included the newer edition.

ahupp avatar Mar 28 '23 21:03 ahupp