wasmbuild_example icon indicating copy to clipboard operation
wasmbuild_example copied to clipboard

can't find crate for `core`

Open jxuanli opened this issue 3 years ago • 3 comments

error[E0463]: can't find crate for `core`
  |
  = note: the `wasm32-unknown-unknown` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

error[E0463]: can't find crate for `compiler_builtins`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
cargo build failed

I got this error when running deno task wasmbuild and the command rustup target add wasm32-unknown-unknown didn't work, I am wondering how I should fix this? Thanks!

jxuanli avatar Jul 11 '22 21:07 jxuanli

What's the full log? wasmbuild should run rustup target add wasm32-unknown-unknown for you if not installed.

What's the output of: rustup --version and rustc --version?

dsherret avatar Jul 11 '22 22:07 dsherret

The full log:

>>>deno task wasmbuild
Warning deno task is unstable and may drastically change in the future
Task wasmbuild deno run -A https://deno.land/x/[email protected]/main.ts
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   C:\TempAccess\rusty_playground\chat\rs_lib\Cargo.toml
workspace: C:\TempAccess\rusty_playground\chat\Cargo.toml
Ensuring wasm32-unknown-unknown target installed...
info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date
Building rs_lib web assembly...
  cargo build --lib -p rs_lib --target wasm32-unknown-unknown --release
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   C:\TempAccess\rusty_playground\chat\rs_lib\Cargo.toml
workspace: C:\TempAccess\rusty_playground\chat\Cargo.toml
   Compiling cfg-if v1.0.0
   Compiling proc-macro2 v1.0.40
   Compiling quote v1.0.20
   Compiling log v0.4.17
   Compiling wasm-bindgen-shared v0.2.81
   Compiling syn v1.0.98
   Compiling wasm-bindgen v0.2.81
error[E0463]: can't find crate for `core`
  |
  = note: the `wasm32-unknown-unknown` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

error[E0463]: can't find crate for `compiler_builtins`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
cargo build failed

rustup:

>>>rustup --version
rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.63.0-nightly (bb8c2f411 2022-06-19)`

rustc:

>>> rustc --version
rustc 1.61.0 (fe5b13d68 2022-05-18)

jxuanli avatar Jul 12 '22 00:07 jxuanli

Hmmm, that's strange. I wonder if it has to do with:

info: The currently active `rustc` version is `rustc 1.63.0-nightly (bb8c2f411 2022-06-19)`

Maybe try running:

rustup update
rustup default stable

dsherret avatar Jul 12 '22 02:07 dsherret