Wasm js-demo errors when running with yarn
adomasven opened this issue · comments
→ yarn -v
1.19.2
→ wasm-pack -V
wasm-pack 0.8.1
→ yarn && yarn start
yarn install v1.19.2
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.42s.
yarn run v1.19.2
$ webpack-dev-server --open -d --compress
🧐 Checking for wasm-pack...
✅ wasm-pack is installed.
ℹ️ Compiling your crate in development mode...
ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /home/adomas/zotero/citeproc-rs/crates/wasm/js-demo/dist
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
error: the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel
See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit code: 101
Since I mentioned this in #31, let's just do a separate issue. This is running on Ubuntu 18.04, running wasm-pack
standalone works fine.
The error message tells you what you need to know there. You’re running stable rust and it requires nightly rust. So rustup update nightly
, and then rustup override set nightly
in the repository root.
I explained why in #18 (comment)
Ah right. Sorry, none of this toolchain is something that I have ever used, so I'm clearly being a bit clumsy.
It’s ok, it takes a while. The toolchain as a whole has extremely good error reporting, which often has a link or instructions for troubleshooting (eg rustc --explain, the compiler’s suggestions) that my eyes glossed over for ages as I was used to errors being bad and having to fend for myself. So if in doubt, trust the errors!