{"record":{"id":"753b5fba7be78eb0","repo":"denoland/deno","slug":"workspace-root-is-not-a-local-directory","errorCode":null,"errorMessage":"workspace root is not a local directory","messagePattern":"workspace root is not a local directory","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/check.rs","lineNumber":73,"sourceCode":"  check_flags: CheckFlags,\n) -> Result<(), AnyError> {\n  if check_flags.doc || check_flags.doc_only {\n    // Doc snippet extraction was handled by Deno 2.x's forked tsc; the native\n    // compiler does not type-check markdown/JSDoc snippets yet.\n    log::warn!(\n      \"{} --doc/--doc-only is not yet supported by the native type checker and will be ignored\",\n      colors::yellow(\"Warning\")\n    );\n  }\n\n  let factory = CliFactory::from_flags(flags.clone());\n  let cli_options = factory.cli_options()?;\n  let project_root = cli_options\n    .workspace()\n    .root_dir_url()\n    .to_file_path()\n    .map_err(|_| {\n      deno_core::anyhow::anyhow!(\"workspace root is not a local directory\")\n    })?;\n\n  // Build the module graph over the requested roots (or the whole project).\n  // Deno owns resolution: this drives deno's own graph diagnostics (missing\n  // modules + hints) and the incremental type-check cache, so we can skip the\n  // external compiler entirely when nothing it sees has changed.\n  // Resolve the requested roots the same way `deno check` always has:\n  // globs are expanded, workspace `exclude` is applied, and\n  // `include_ignored_specified: false` means an explicitly-passed excluded file\n  // is skipped rather than force-checked. An empty result is not an error - it\n  // just means there's nothing to check (e.g. every match was excluded), which\n  // deno reports as a warning and a clean exit.\n  let graph_container = factory.main_module_graph_container().await?;\n  let mut roots = graph_container.collect_specifiers(\n    &check_flags.files,\n    crate::graph_container::CollectSpecifiersOptions {\n      include_ignored_specified: false,\n    },","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tools/check.rs#L55-L91","documentation":"`deno check` (native type-checker path) converts the workspace root URL to a local directory path because the whole native pipeline (generated tsconfig, incremental cache keyed by paths) assumes a real filesystem root. If the workspace root is not a `file://` URL, the conversion fails and checking aborts.","triggerScenarios":"A workspace whose root resolves to a non-file URL — configuration discovered from a remote/virtual context, or embedded/sandboxed hosts where the project root is not a local directory on disk.","commonSituations":"Rare: running deno check inside unusual sandboxes, containers with virtual mounts, or environments where cwd/config resolution yields a non-file root. Everyday local projects never hit it.","solutions":["Run `deno check` from a real local directory that contains (or is covered by) a local deno.json/deno.jsonc","Verify the project root is an actual on-disk directory and not a virtual/remote mount","If the setup looks valid and it still fails, attach `deno info` output and report an issue"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Preflight for scripts that drive deno check\nconst cwd = Deno.cwd();\nconst info = Deno.statSync(cwd);\nif (!info.isDirectory) {\n  throw new Error(\"deno check requires a local directory workspace root\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run deno check from a real project directory with a local deno.json","Avoid virtual/remote mounts as the workspace root","Report valid setups that still trigger it, with `deno info` output"],"tags":["check","workspace","filesystem","config"],"backgroundTag":"workspace-not-local","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"}