question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tutorial 4: kittes pallet serde import error on both monthly-2021-11-1 and monthly-2021-11-0

See original GitHub issue

_Originally posted by @luatnd in https://github.com/substrate-developer-hub/substrate-docs/issues/516#issuecomment-973129038_


For the latest guide, I got this error on the tutorial 4: kittes pallet: if I using monthly-2021-10

error[E0463]: can't find crate for `serde`
  --> pallets/kitties/src/lib.rs:42:37
   |
42 |     #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
   |                                        ^^^^^^^^^ can't find crate
   |
   = note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)

My solution is update all dependencies to latest tag following this commit

But… without success 😄


Also the case for me using the newly updated kickstart-substrate that has frame-system monthly-2021-11-1 ‘4.0.0-dev’

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
sacha-lcommented, Nov 23, 2021

👍🏻 Yes - good call.

0reactions
pyramid-songscommented, Nov 22, 2021

Thanks @sacha-l - adding a serde dependency into the pallet Cargo.toml worked and I can compile my code. I was under the impression that frame_support was going to handle the serde functions because of this line:

#[cfg(feature = "std")]
use frame_support::serde::{Deserialize, Serialize};

As for the tutorial documentation, definitely worth prompting the user to add the serde dependency in step 2 of this section or instead editing the default pallet Cargo.toml that comes with the kickstart so they don’t have to do it themselves.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found