E0432: unresolved import Rust Origin: Application & API Last updated 5 Nov 2026

Rust: error[E0432]: unresolved import `crate::utils` — maybe a missing crate `utils`?

A use path doesn't point to an existing module, crate or item.

Exact message you may see error[E0432]: unresolved import `crate::utils`unresolved import `serde` maybe a missing crate `serde`?error[E0432]: unresolved import `super::foo`no `Foo` in the rootuse of undeclared crate or module
Seen on: Rust

Meaning

Declare the module (mod utils; in main.rs/lib.rs), check file paths (utils.rs or utils/mod.rs), add the dependency in Cargo.toml (and use the crate name with _ for -), make items pub, and use crate::/self::/super:: correctly. 2018+ edition: paths start with crate names or crate.

Common causes

  • Missing mod x; declaration
  • Dependency not in Cargo.toml (or wrong name)
  • Item not pub or wrong path
  • File named differently
  • Edition path differences

⚡ Quick fix

  1. Add mod utils; in the crate root
  2. cargo add crate_name
  3. Make the item pub and fix the path

Detailed fix by platform

Rust

  1. cargo add serde --features derive && cargo check

How to diagnose

  1. Module — Declared?
  2. Crate — In Cargo.toml?
  3. Visibility — pub?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

Blocking waiting for file lock on package cache / build directory — Cargo: Blocking waiting for file lock on package cache / on build directory (Rust)Blocking waiting for …cannot find package in any of GOROOT / GOPATH — Go: cannot find package "github.com/pkg/errors" in any of: /usr/local/go/src/github.com/pkg/errors (from $GOROOT) /go/src/github.com/pkg/errors (from $GOPATH) (Go)cannot find package i…cargo: failed to get from registry (spurious network error) — Cargo: warning: spurious network error (2 tries remaining): [35] SSL connect error / error: failed to download from `https://index.crates.io/...` (Rust)cargo: failed to get …cargo: failed to select a version for the requirement — Cargo: error: failed to select a version for the requirement `serde = "^2.0"` — candidate versions found which didn't match: 1.0.197 (Rust)cargo: failed to sele…declared and not used — Go: declared and not used: x / "fmt" imported and not used (Go)declared and not usedE0412: cannot find type in this scope — Rust: error[E0412]: cannot find type `User` in this scope (Rust)E0412: cannot find ty…E0425: cannot find value in this scope — Rust: error[E0425]: cannot find value `x` in this scope (Rust)E0425: cannot find va…E0433: failed to resolve: use of undeclared type or module — Rust: error[E0433]: failed to resolve: use of undeclared type `HashMap` (Rust)E0433: failed to reso…E0432: un…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.