JoshOrndorff / recipes

A Hands-On Cookbook for Aspiring Blockchain Chefs
GNU General Public License v3.0
379 stars 187 forks source link

error: could not compile `api-runtime` due to 5 previous errors #467

Closed hqwangningbo closed 3 years ago

hqwangningbo commented 3 years ago

Recently, I was studying substrat. I am getting the following error on M1 chip. The following warnings were emitted during compilation:

error[E0107]: this enum takes 1 generic argument but 0 generic arguments were supplied --> /Users/wangningbo/StudySubstrate/recipes/runtimes/api-runtime/src/lib.rs:214:1 214 / construct_runtime!( 215 pub enum Runtime where 216 Block = Block, 217 NodeBlock = opaque::Block, ... 227 } 228 ); __^ expected 1 generic argument
note: enum defined here, with 1 generic parameter: T --> /Users/wangningbo/StudySubstrate/recipes/pallets/sum-storage/src/lib.rs:27:11 27 pub enum Event { ^^^^^ - = note: this error originates in the macro $crate::impl_outer_event (in Nightly builds, run with -Z macro-backtrace for more info) help: add missing generic argument
477 $module_name::Event <T $( $generic_param, )? $( $module_name::$generic_instance )? >, Self::Error
+

For more information about this error, try rustc --explain E0107. error: could not compile api-runtime due to 5 previous errors warning: build failed, waiting for other jobs to finish... error: build failed

What is the reason 😭?

success-0627 commented 3 years ago

Same here too. Compile works on (below version would be same with substrate playground)

rustup 1.23.1 (3df2264a9 2020-11-30)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.49.0-nightly (beb5ae474 2020-10-04)`

And, above issue happens on

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.55.0 (c8dfcfe04 2021-09-06)`
success-0627 commented 3 years ago

Is there any solution for this? Thank you

stiiifff commented 3 years ago

@hqwangningbo @zl910627 Fixed by https://github.com/substrate-developer-hub/recipes/pull/469

success-0627 commented 3 years ago

hi @stiiifff great working!

hqwangningbo commented 3 years ago

hi @stiiifff Thank you for your job! nice👍

SotaTek-TungNguyen2 commented 3 years ago

thanks, @stiiifff