Skip to main content
11 votes
Accepted

ERROR: Loading of original wasm failed

Solved! This was caused by the nightly toolchain. Switching to the stable toolchain solved this issue. Edit: As pointed out by Shunsuke, this is specific to the 1.70.0 nightly build. 1.68.0 version ...
statisticalanomaly's user avatar
6 votes
Accepted

What is the difference between dependencies and dev-dependencies in Cargo.toml

This is a general Rust concept: https://doc.rust-lang.org/rust-by-example/testing/dev_dependencies.html Basically, [dev-dependencies] are the crates you only need for compiling and running tests. ...
Shawn Tabrizi's user avatar
  • 16.1k
5 votes
Accepted

Cargo contract 3.0.1

Could you try hardcoding version = "=3.0.1"? The "=x.x.x" will pin this very version.
cmichi's user avatar
  • 2,800
5 votes
Accepted

Building a substrate node template with a global cargo `target` directory

What seems to be happening is that the wasm_builder builds the runtime in a nested location in the target directory: target debug wbuild node-template-runtime ...
Dcompoze's user avatar
  • 620
4 votes

ERROR: Loading of original wasm failed

For cases where updated nightly is still preferred for whatever reason: rustup update rustup install nightly-2023-02-07-aarch64-apple-darwin rustup component add rust-src --toolchain nightly-2023-02-...
blairmunroakusa's user avatar
4 votes
Accepted

Build the Substrate Kitties Chain Tutorial Cargo Error

Please try again with a fresh clone. The template has been updated and now uses Substrate's polkadot-v0.9.17 branch, pulling in new updates that should fix the issues above. Also comment out this line ...
Deepak Chaudhary's user avatar
4 votes
Accepted

Which toolchain should I use to build Substrate

TL;DR: you likely should use the latest of both stable and nightly when building Substrate chains at any given time. Update regularly with rustup update. It is quite likely the toolchain you should ...
Nuke's user avatar
  • 1,842
3 votes

Error: failed to run custom build command for `tikv-jemalloc-sys v0.4.3+5.2.1-patched.2`

Problem compiling substrate node in WSL ( windows ) Following solved the issue. Was missing wasm32 as installation target.
gmluqa's user avatar
  • 91
3 votes

cargo contract throws error about supplied arguments in ` #[ink(constructor)]` for version 3.0.1

I've reproduced your issue and I believe it was an error on our end which caused this. It looks like we introduced a breaking change in the codegen as part of ink! 3.2, sorry! This change was related ...
HCastano's user avatar
  • 1,071
3 votes
Accepted

cargo contract throws error about supplied arguments in ` #[ink(constructor)]` for version 3.0.1

I had the same situation above. After specify indirect dependencies' version declaratively, I succeded to compile and deploy contracts to the local node with pallet-contracts polkadot-v0.9.19 support. ...
Shunsuke's user avatar
  • 432
3 votes

"error: failed to select a version for `parity-util-mem`"

This mostly happens when updating the polkadot version and you have still an old conflicting polkadot dependency. Try to stay consistent for each my-pallet/Cargo.toml version For example when you use ...
Chralt's user avatar
  • 543
3 votes
Accepted

Failed to get frame-benchmarking as a dependency of package

The error means that you have an inconsistency somewhere in one of your cargo manifests (Cargo.toml files). It is requesting the Benchmarking pallet, but it is not included. Would would need to give ...
T9b's user avatar
  • 468
2 votes

Build the Substrate Kitties Chain Tutorial Cargo Error

The error here is written to you in the error message: duplicate key: `substrate-build-script-utils` for key `build-dependencies` at line 70 column 1 You have the same import twice in your TOML ...
Shawn Tabrizi's user avatar
  • 16.1k
2 votes

Cargo contract 3.0.1

Thanks for the issue reporting! Its origin is that with ink! 3.1.0 a number of backwards incompatible changes were introduced. That unpleasant mistake is now fixed and with ink! 3.3.0 release being ...
Alexander Gryaznov's user avatar
2 votes
Accepted

Error: 'tikv-jemalloc-sys' fails to build after upgrading substrate-based chain on WSL2

None of the given solutions worked for me. Later when I had my whole directory in the WSL2 file system (instead of the windows file system like earlier) and tried the build command, it worked for me.
SRG's user avatar
  • 36
2 votes

Error: 'tikv-jemalloc-sys' fails to build after upgrading substrate-based chain on WSL2

Got a similar issue when running builds on Ubuntu. Managed to resolve it by installing jemalloc via sudo apt install libjemalloc2
chexware's user avatar
  • 325
2 votes
Accepted

"cargo +nightly contract build" ERROR: no path specified, and the default `src/main.rs` was not found

Moving comment to answer: Double check if there is a parent directory with a Cargo.toml as outlined here https://stackoverflow.com/questions/61134990/cargo-would-not-build-even-when-src-main-rs-is-...
Peter - R0GUE's user avatar
1 vote

Specialization impl does not specialize any associated items

I made these changes to your code and it compiled successfully: I was using these versions: rustc 1.69.0 (84c898d65 2023-04-16) cargo-contract-contract 3.0.1-unknown-x86_64-unknown-linux-gnu rustup 1....
Luke Schoen's user avatar
  • 2,346
1 vote

ERROR: Loading of original wasm failed

ran into the same issue using v3.0 cargo contract , updating cargo contract to v4 solved it. Use cargo install --git https://github.com/paritytech/cargo-contract cargo-contract --force to update
Honour's user avatar
  • 11
1 vote

ERROR: Loading of original wasm failed

Adding a rust toolchain override file can also work. Such as this: [toolchain] channel = "nightly-2023-01-01" components = [ "rustfmt" ] targets = [ "wasm32-unknown-unknown&...
Bruno's user avatar
  • 8,315
1 vote
Accepted

ERROR: Error invoking `cargo metadata` when trying to compile INK! 4.0 smart contract

If you are using latest ink i.e. 4.0.0-beta and latest openbrush, then you have to change little bit in Cargo.toml file. use this for ink package: ink = { git = "https://github.com/paritytech/...
go11li's user avatar
  • 1,241
1 vote

Contract not compiling. "Failed to resolve: use of undeclared type `SecretKey`

this specific error display if you are adding use blst::min_pk::SecretKey; outside mod instead put inside mod flipper { use blst::min_pk::*; } but still this also throws duplicate lang item in crate '...
go11li's user avatar
  • 1,241
1 vote

Unable to compile substrate template `error: failed to run custom build command for `librocksdb-sys v0.8.0+7.4.4`

What solved my problem related with build of frontier, but I believe that is related with librocksdb-sys too, was when I ran these commands which update system packages and add g++ that is a open ...
Juan Colchete's user avatar
1 vote

Unable to compile substrate template `error: failed to run custom build command for `librocksdb-sys v0.8.0+7.4.4`

I recently came across this issue on a fresh Mac with an M2 chip. After running the following commands, it seems to have been resolved: cargo clean cargo update rustup update
phillux's user avatar
  • 11
1 vote
Accepted

Unable to compile substrate template `error: failed to run custom build command for `librocksdb-sys v0.8.0+7.4.4`

I have exactly the same error while building Substrate. The issue is not in Substrate, but rust-rocksdb. More: https://github.com/rust-rocksdb/rust-rocksdb/issues/713
Tomasz Waszczyk's user avatar
1 vote

error: linking with `cc` failed: exit status: 1 (Mac m1)

It is likely because your machine didn't have the minimum required RAM or Swap space free to run Substrate. On macOS you can show CPU and memory usage in the terminal by running top -l 1 | grep -E &...
Luke Schoen's user avatar
  • 2,346
1 vote
Accepted

How do I pin my tracing-core version to 0.1.26?

Looks like there is an issue for this: https://github.com/paritytech/substrate/issues/11855 I was able to replicate this issue on: https://github.com/substrate-developer-hub/substrate-node-template/...
Bruno's user avatar
  • 8,315
1 vote

cargo contract throws error about supplied arguments in ` #[ink(constructor)]` for version 3.0.1

Thanks for the issue reporting! Its origin is described in detail in @HCastano's answer, and is now fixed in the upcoming ink! 3.3.0 release along with other backwards compatibility breaking issues. ...
Alexander Gryaznov's user avatar
1 vote

How to resolve conflicted dependency versions when import frame_support

(Preferably dump text rather than images as we can copy paste and try things). In this case I would suggest pulling in the sp-keyring from master substrate: https://github.com/paritytech/substrate/...
Squirrel's user avatar
  • 3,849
1 vote

Cargo contract 3.0.1

There is a lot of transitive dependencies (pallets that ink pallets themselves depend on), as you can check by inspecting Cargo.lock - it will pull the most recent versions for those (3.2.0 as of now)....
fbielejec's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible