wasm-bindgen CLI not working when trying to build

203 views Asked by At

When I try to use wasm-pack build, it outputs the following (with RUST_BACKTRACE=full):

[INFO]:   Checking for the Wasm target...
[INFO]:   Compiling to Wasm...
    Finished release [optimized] target(s) in 0.01s
[INFO]: ⬇️  Installing wasm-bindgen...
thread 'main' panicked at crates/cli-support/src/descriptor.rs:222:15:
index out of bounds: the len is 0 but the index is 0
stack backtrace:
   0:        0x104e7b96b - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h65343ad3a85b4e34
   1:        0x104e99acb - core::fmt::write::h11839d3825cb5605
   2:        0x104e78e9e - std::io::Write::write_fmt::h3ab12d369399333c
   3:        0x104e7b749 - std::sys_common::backtrace::print::h405f7c76ca12eb27
   4:        0x104e7cdc5 - std::panicking::default_hook::{{closure}}::hed87c355606e1822
   5:        0x104e7caf1 - std::panicking::default_hook::hdf696ec8ea0d65aa
   6:        0x104e7d330 - std::panicking::rust_panic_with_hook::h7c5059af1af54377
   7:        0x104e7d253 - std::panicking::begin_panic_handler::{{closure}}::hd658b0e1cffe3d4d
   8:        0x104e7be49 - std::sys_common::backtrace::__rust_end_short_backtrace::h3d7834d0cea60a50
   9:        0x104e7cf7d - _rust_begin_unwind
  10:        0x104ec4b83 - core::panicking::panic_fmt::ha9964785de0afb40
  11:        0x104ec4cd2 - core::panicking::panic_bounds_check::ha3cb2c69f1775d16
  12:        0x104cff9c8 - wasm_bindgen_cli_support::descriptor::Descriptor::_decode::hcf7e629581de6fe9
  13:        0x104cf79d5 - wasm_bindgen_cli_support::descriptors::execute::h02522f0eed98264f
  14:        0x104ce2dc4 - wasm_bindgen_cli_support::Bindgen::generate_output::h1326299c76136af7
  15:        0x104c75c49 - wasm_bindgen::main::h2a010fa27f679ef8
  16:        0x104c73b56 - std::sys_common::backtrace::__rust_begin_short_backtrace::h2dd174074676d721
  17:        0x104c73b6c - std::rt::lang_start::{{closure}}::h0074e5c032d1ff00
  18:        0x104e742ca - std::rt::lang_start_internal::h54faea1e36783632
  19:        0x104c7620c - _main
Error: Running the wasm-bindgen CLI
Caused by: Running the wasm-bindgen CLI
Caused by: failed to execute `wasm-bindgen`: exited with exit status: 101
  full command: "/Users/gabrielramalho/Library/Caches/.wasm-pack/wasm-bindgen-3a58835161a6b92c/wasm-bindgen" "/Users/gabrielramalho/Desktop/multiple-pendulum/target/wasm32-unknown-unknown/release/multiple_pendulum.wasm" "--out-dir" "/Users/gabrielramalho/Desktop/multiple-pendulum/pkg" "--typescript" "--target" "bundler"

where /Users/gabrielramalho/Desktop/multiple-pendulum is the correct directory of the project.

I searched the error up on google and found an issue that pointed out that the CLI and crate versions of wasm-bindgen needed to be the same. They were, indeed, not the same: the create version was 0.2.84, while the CLI version was 0.2.88.
But even then, after I changed Cargo.toml to use wasm-bindgen 0.2.88, the issue persisted, and I did not find anything else just by googling.

0

There are 0 answers