{"record":{"id":"47a24998f3c4ec13","repo":"denoland/deno","slug":"type-checking-failed-47a249","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/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tools/check.rs#L271-L307","documentation":"`deno check` failed because every requested root was a missing local file: the module graph had diagnostics (e.g. 'Module not found') and no existing files remained for tsc to check. Deno prints the graph diagnostics first, then exits with this error so the failure is reflected in the exit code.","triggerScenarios":"`deno check typo.ts` where the file does not exist; every passed path or glob matches nothing on disk, so `files` is empty while `root_diagnostics` has entries.","commonSituations":"Typos in file paths; files moved or renamed; CI checkouts missing generated files; globs that match nothing.","solutions":["Fix the paths passed to `deno check` — the printed graph diagnostic names each missing module","If the files are generated, generate them before the check step (e.g. `deno task codegen && deno check`)","Verify glob roots in CI match the actual layout rather than ignoring the error"],"exampleFix":"# before\ndeno check src/typo.ts\n\n# after\ndeno check src/types.ts","handlingStrategy":"validation","validationCode":"// Pre-check every root before invoking deno check\nconst paths = [\"src/types.ts\"];\nfor (const p of paths) {\n  await Deno.stat(p); // throws a clear error if a root is missing\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate files before the check step in CI pipelines","Double-check paths and globs passed to deno check","Watch for rename/move refactors that leave stale check commands"],"tags":["check","module-not-found","cli"],"backgroundTag":"type-check-entry-missing","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}