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.
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 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
pubor wrong path - File named differently
- Edition path differences
⚡ Quick fix
- Add
mod utils;in the crate root cargo add crate_name- Make the item
puband fix the path
Detailed fix by platform
Rust
cargo add serde --features derive && cargo check
How to diagnose
- Module — Declared?
- Crate — In Cargo.toml?
- 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:
Similar errors
- Blocking waiting for file lock on package cache / build directory Cargo: Blocking waiting for file lock on package cache / on build directory
- 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)
- 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/...`
Most viewed in Rust
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 5 Nov 2026