Build the project using wasm-pack build, as instructed;
See the error.
Expected behavior
Successful compilation, with no errors.
Screenshots
Not really a screenshot, but here's the output from wasm-pack:
PS D:\fakepath> wasm-pack.exe build
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
Compiling wasm-game-of-life v0.1.0 (D:\fakepath)
error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
--> src\lib.rs:1:1
|
1 | extern crate cfg_if;
| ^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/27812
error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
--> src\lib.rs:6:5
|
| ^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/27812
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.
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
Additional context
This can be solved by simply adding cfg-if = "0.1.10" to the [dependencies] table in Cargo.toml.
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
wasm-pack build
, as instructed;Expected behavior Successful compilation, with no errors.
Screenshots Not really a screenshot, but here's the output from
wasm-pack
:Additional context This can be solved by simply adding
cfg-if = "0.1.10"
to the[dependencies]
table inCargo.toml
.