External crate referenced in code isn't in the build graph.
extern crate serde; // E0463: can't find crate `serde`
The crate isn't declared as a dependency. In edition 2018+ you usually don't need extern crate at all — use the dep directly via use serde::.... The error appears when:
- Crate missing from Cargo.toml.
- Crate name has a typo.
- Targeting a feature-gated crate without enabling the feature.
- Cross-compiling and the crate isn't built for that target.
- cargo add serde — Cargo edits the manifest and downloads.
- For workspace crates, list the path: mycrate = { path = "../mycrate" }.
- Drop extern crate in 2018+ unless you're using #[macro_use] for old-style macro imports.
- Run cargo check after each Cargo.toml edit to confirm resolution.