Skip to main content

Overview

The rev-dep unresolved command detects and lists imports that could not be resolved during import resolution. This helps identify broken imports, missing files, or configuration issues in your project. The output groups imports by file, making it easy to identify which files have resolution problems.

Usage

rev-dep unresolved [flags]

Flags

--condition-names
string[]
List of conditions for package.json imports resolution (e.g. node, imports, default)
--custom-asset-extensions
string[]
Additional asset extensions treated as resolvable (e.g. glb,mp3)
-c, --cwd
string
default:"$PWD"
Working directory for the command
--follow-monorepo-packages
string[]
Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names
--ignore
map[string]string
default:"[]"
Map of file path (relative to cwd) to exact import request to ignore (e.g. —ignore src/index.ts=some-module)
--ignore-files
string[]
File path glob patterns to ignore in unresolved output
--ignore-imports
string[]
Import requests to ignore globally in unresolved output
--package-json
string
default:"./package.json"
Path to package.json
--tsconfig-json
string
default:"./tsconfig.json"
Path to tsconfig.json
-v, --verbose
boolean
Show warnings and verbose output
-h, --help
boolean
Help for unresolved command

Examples

Check for unresolved imports

rev-dep unresolved

Ignore specific imports globally

rev-dep unresolved --ignore-imports="@mocked/module" --ignore-imports="virtual:*"
Useful for ignoring known virtual modules or mocked dependencies used in tests.

Ignore specific file-import combinations

rev-dep unresolved --ignore src/index.ts=some-module --ignore src/test.ts=mock-module

Ignore all test files

rev-dep unresolved --ignore-files="**/*.test.ts" --ignore-files="**/*.spec.ts"

Handle custom asset types

rev-dep unresolved --custom-asset-extensions=glb,mp3,wav,gltf
If your project imports 3D models or audio files, add their extensions so they’re treated as resolvable.

Check with monorepo support

rev-dep unresolved --follow-monorepo-packages

Use custom config files

rev-dep unresolved --tsconfig-json ./tsconfig.build.json --package-json ./package.json

Common Causes of Unresolved Imports

If you use path aliases like @/components, ensure they’re configured in tsconfig.json under compilerOptions.paths.
For monorepos, ensure packages define proper exports fields in their package.json.
Importing ./file.jsx when the file is actually ./file.tsx, or missing extensions entirely.
The imported package isn’t installed or isn’t listed in package.json. See node-modules missing command.
Importing images, CSS, or other assets without proper TypeScript or bundler configuration.

Use Cases

CI/CD validation

Run this command in CI to catch broken imports before they reach production.

Migration verification

After refactoring or moving files, verify all imports still resolve correctly.

TypeScript configuration debugging

Identify issues with path aliases, module resolution, or tsconfig settings.
  • resolve - Trace how imports are resolved
  • imported-by - Find files that import a target file

Build docs developers (and LLMs) love