{"record":{"id":"47a24998f3c4ec13","repo":"denoland/deno","slug":"type-checking-failed","errorCode":null,"errorMessage":"Type checking failed.","messagePattern":"Type checking failed\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/check.rs","lineNumber":289,"sourceCode":"  // it under `.deno/remote/`. Pin tsc to those mirror files too, so a remote\n  // entrypoint is checked as itself rather than triggering the whole-project\n  // `include` fallback below (which would check unrelated files, or nothing).\n  files.extend(remote_root_mirror_files(&project_root, &roots));\n\n  // Render each root relative to the invocation directory, matching deno's own\n  // `Check <specifier>` output.\n  let current_dir =\n    deno_path_util::url_from_directory_path(cli_options.initial_cwd())\n      .map_err(|e| deno_core::anyhow::anyhow!(\"{e}\"))?;\n\n  // Every requested root was a missing (non-existent) local entrypoint: there's\n  // nothing for tsc to check, so report deno's graph diagnostics for them\n  // directly instead of falling back to the base config's project-wide\n  // `include` (which would check unrelated files).\n  if files.is_empty() && root_diagnostics.has_diagnostic() {\n    log_check_roots(&roots, &current_dir);\n    log::error!(\"{}\\n\", root_diagnostics);\n    return Err(deno_core::anyhow::anyhow!(\"Type checking failed.\"));\n  }\n\n  // Holds the per-file config's temp file open until tsc has run (dropping it\n  // deletes the file).\n  let _check_tsconfig_guard;\n  let tsconfig_path = if files.is_empty() {\n    base_tsconfig\n  } else {\n    // `deno check <files>` checks only the named files (and their imports), not\n    // the whole project. The generated `tsconfig.json` keeps an open `include`\n    // (so bundlers can consume its resolver mappings), so write a per-file\n    // config that extends it (by absolute path) and pins `files` - `files`/\n    // `include` are not inherited through `extends`, so only these files are\n    // type-checked while compilerOptions/paths still apply. `include: []`\n    // nullifies the base's open `include` (tsc unions `files` with an inherited\n    // `include`, which would otherwise re-add the whole project).\n    //\n    // `files`/`include` are not inherited through `extends`, so the base config's","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/check.rs#L271-L307","documentation":"Native check short-circuit: every requested root was a missing (non-existent) local file, so there is nothing for tsc to check; deno's graph diagnostics for those roots are logged (log::error above), and the run exits with this error to report failure (cli/tools/check.rs:282-290). The real information - which paths are missing - is in the diagnostics printed before it.","triggerScenarios":"'deno check typo.ts' / 'deno check src/missng.ts' where the file does not exist; a glob expanding to nothing with an explicitly-named missing file; build scripts referencing moved/deleted files.","commonSituations":"Typos in CI check commands; renamed modules with stale references in scripts; files not yet generated (codegen step not run before deno check).","solutions":["Look at the diagnostics printed above the error - they name each missing specifier","Fix the path/typo, or generate/create the file before checking (run codegen first)","Clean stale references out of check scripts when modules are renamed or deleted"],"exampleFix":"# before\ndeno check src/missng.ts   # 'Type checking failed.' + TS2307-style missing-module diagnostics\n# after\ndeno check src/missing.ts","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# Existence-check every explicit root before native check\nfor f in \"$@\"; do\n  [ -e \"$f\" ] || { echo \"no such file: $f\"; exit 2; }\ndone\ndeno check \"$@\"","typeGuard":null,"tryCatchPattern":"# Distinguish 'missing file' failures from real type errors in CI\ndeno check src/**/*.ts 2>&1 | tee check.log; rc=${PIPESTATUS[0]}\n[ $rc -eq 0 ] || grep -q 'Cannot find module' check.log && echo 'missing-module path in roots - check file names/codegen'\nexit $rc","preventionTips":["Run codegen steps before deno check so generated files exist","Update check scripts when modules are renamed or deleted","Let globs (deno check src/) instead of stale file lists drive CI checks"],"tags":["check","file-not-found","typescript","cli"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}