Overview
Therev-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
Flags
List of conditions for package.json imports resolution (e.g. node, imports, default)
Additional asset extensions treated as resolvable (e.g. glb,mp3)
Working directory for the command
Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names
Map of file path (relative to cwd) to exact import request to ignore (e.g. —ignore src/index.ts=some-module)
File path glob patterns to ignore in unresolved output
Import requests to ignore globally in unresolved output
Path to package.json
Path to tsconfig.json
Show warnings and verbose output
Help for unresolved command
Examples
Check for unresolved imports
Ignore specific imports globally
Ignore specific file-import combinations
Ignore all test files
Handle custom asset types
Check with monorepo support
Use custom config files
Common Causes of Unresolved Imports
Missing TypeScript path mappings
Missing TypeScript path mappings
If you use path aliases like
@/components, ensure they’re configured in tsconfig.json under compilerOptions.paths.Missing package.json exports
Missing package.json exports
For monorepos, ensure packages define proper
exports fields in their package.json.Incorrect file extensions
Incorrect file extensions
Importing
./file.jsx when the file is actually ./file.tsx, or missing extensions entirely.Missing dependencies
Missing dependencies
The imported package isn’t installed or isn’t listed in package.json. See node-modules missing command.
Asset imports without loader configuration
Asset imports without loader configuration
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.
Related Commands
- resolve - Trace how imports are resolved
- imported-by - Find files that import a target file
