TypeScript Compiler Options
traceResolution — TypeScript compiler diagnostics
Logs module and type-reference resolution attempts and outcomes. Use the trace to inspect lookup strategies, missing packages or unexpected declaration selection. It can be verbose and reveal local paths; sanitize before sharing. A successful compiler lookup does not prove runtime loading will succeed. Baseline: TypeScript 5.8.3. Default: false. Create the labeled files in an isolated directory and run the commands below. The trace shows that ./dep resolves to dep.ts.
Formal Syntax & Structure
typescript syntaxtypescript
{ "compilerOptions": { "traceResolution": true }}Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| traceResolution | boolean | Compiler option; default: false. |
Working Example
Example Snippettypescript
// File: tsconfig.json (omit this label){ "compilerOptions": { "target": "ES5", "module": "CommonJS", "lib": [ "ES5" ], "strict": true, "types": [], "outDir": "dist", "noEmitOnError": true, "traceResolution": true, "noEmit": true }, "files": [ "index.ts" ]}// File: index.ts (omit this label)import { value } from "./dep";export const count = value;// File: dep.ts (omit this label)export const value = 7;
// Run these commands in order in an isolated project:// tsc -p . --pretty false