0

I have been running into a compilation error when adding different features in our node. This error appeared when I added the vesting pallet. It also appeared when I was configuring the runtime for something completely separate a month ago. The issue is I have no idea what is causing it since it doesn't point to any place for error. A copy of the error message can be seen below:

error: cannot find macro `vec` in this scope
   --> /Users/jackson/.cargo/git/checkouts/substrate-7e08433d4c370a21/22d40c7/primitives/npos-elections/src/lib.rs:367:45
    |
367 |         Self { total: Default::default(), voters: vec![] }
    |                                                   ^^^
    |
    = note: consider importing one of these items:
            codec::alloc::vec
            crate::sp_std::vec
            scale_info::prelude::vec
            sp_std::vec

error: cannot find macro `vec` in this scope
   --> /Users/jackson/.cargo/git/checkouts/substrate-7e08433d4c370a21/22d40c7/primitives/npos-elections/src/reduce.rs:608:21
    |
608 |                     let min_edge = vec![min_voter, min_target];
    |                                    ^^^
    |
    = note: consider importing one of these items:
            codec::alloc::vec
            crate::sp_std::vec
            scale_info::prelude::vec
            sp_std::vec

error: cannot find macro `vec` in this scope
  --> /Users/jackson/.cargo/git/checkouts/substrate-7e08433d4c370a21/22d40c7/primitives/npos-elections/src/phragmms.rs:52:20
   |
52 |     let mut winners = vec![];
   |                       ^^^
   |
   = note: consider importing one of these items:
           codec::alloc::vec
           crate::sp_std::vec
           scale_info::prelude::vec
           sp_std::vec

error: could not compile `sp-npos-elections` due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed

Any help would be appreciated as I have no idea what the possible causes are.

1

1 Answer 1

1

The error was caused by some format errors when configuring the runtime for the pallet I added. The first issue was the pallet was not imported and the second is when I used asterisks instead of quotes for the std configuration.

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Jul 20, 2022 at 9:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.