I am currently facing this Error:
Using rustc version: rustc 1.62.0-nightly (e85edd9a8 2022-04-28)
Compiling frame-support v4.0.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.19#174735ea)
error: cannot find macro `vec` in this scope
--> /home/creestl/.cargo/git/checkouts/substrate-7e08433d4c370a21/174735e/frame/support/src/traits/storage.rs:77:17
|
77 | let mut res = vec![];
| ^^^
|
= note: consider importing one of these items:
codec::alloc::vec
crate::sp_std::vec
scale_info::prelude::vec
sp_std::vec
(it says that std
macro is used when building for no-std
)
The frame-support
import in my Cargo.toml
looks like this:
frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.19" }
***snip***
[features]
default = ["std"]
std = [
"parity-scale-codec/std",
"scale-info/std",
"frame-support/std",
"frame-system/std",
"frame-benchmarking/std",
]
So I did not modify any code of that pallet. It is not some kind of custom pallet. This code above is from substrate-node-template.
To build a node I use cargo build --release
command.
I know that runtime builds in no-std
. But I haven't had such error with that pallet before.
[UPD] I get the same error with finality-grandpa as well
error: cannot find macro `format` in this scope
--> /home/creestl/.cargo/git/checkouts/substrate-7e08433d4c370a21/174735e/primitives/finality-grandpa/src/lib.rs:43:2
|
43 | app_crypto!(ed25519, GRANDPA);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: consider importing one of these items:
alloc::format
scale_info::prelude::format
= note: this error originates in the macro `$crate::app_crypto_public_common_if_std` (in Nightly builds, run with -Z macro-backtrace for more info)
Please assist. I've been trying to fix this for several days now.
std
feature to any imported crates?std
is listed in[features]
error: cannot find macro 'format' in this scope
when doing acargo check
in my runtime folder. this started after I added a new pallet to my runtime, and updated the versions in thecargo.toml
in the runtime. definitely a dependency problem, still trying to figure it out.....