Cannot build rustwasm-worker-template

Hi. I’m new to cloudflare and am testing out the wrangler cli. I ran:
wrangler generate wasm-worker
and then tried to build it using “wasm-pack build”. The resulting 3 errors are below. I followed all the steps in the wrangler cli quick start tutorial, so I’m not sure if there is something off with my environment or there is a bug in the rustwasm-worker-template. Has anyone seen this error before and is there a simple fix that I’m missing?

[INFO]: :dart: Checking for the Wasm target…
[INFO]: :cyclone: Compiling to Wasm…
Compiling proc-macro2 v1.0.26
Compiling unicode-xid v0.2.1
Compiling wasm-bindgen-shared v0.2.65
Compiling log v0.4.14
Compiling syn v1.0.69
Compiling cfg-if v1.0.0
Compiling lazy_static v1.4.0
Compiling bumpalo v3.6.1
Compiling wasm-bindgen v0.2.65
Compiling cfg-if v0.1.10
Compiling quote v1.0.9
Compiling wasm-bindgen-backend v0.2.65
Compiling wasm-bindgen-macro-support v0.2.65
Compiling wasm-bindgen-macro v0.2.65
Compiling console_error_panic_hook v0.1.6
error: expected ,
→ /Users/jason/.cargo/registry/src/
80 | #[wasm_bindgen(js_namespace = console)]
| ^^^^^^^

error[E0433]: failed to resolve: use of undeclared type Error
→ /Users/jason/.cargo/registry/src/
106 | let e = Error::new();
| ^^^^^ not found in this scope
help: consider importing one of these items
71 | use std::error::Error;
71 | use std::io::Error;
71 | use wasm_bindgen::__rt::core::fmt::Error;

error[E0425]: cannot find function error in this scope
→ /Users/jason/.cargo/registry/src/
117 | error(msg);
| ^^^^^ not found in this scope

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0425, E0433.
For more information about an error, try rustc --explain E0425.
error: could not compile console_error_panic_hook

To learn more, run the command again with --verbose.
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute cargo build: exited with exit code: 101
full command: “cargo” “build” “–lib” “–release” “–target” “wasm32-unknown-unknown”

I’m experiencing the exact same issue here in Fedora-34, I install all the rust dependencies and everything but this error keeps coming up.

This topic was automatically closed after 31 days. New replies are no longer allowed.