{"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/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/check.rs#L55-L91","documentation":"The native type checker derives a project root path from the workspace's root_dir_url via Url::to_file_path (cli/tools/check.rs:68-74); the conversion fails when the root is not a file:// URL. Native check materializes tsconfigs and syncs types under that directory, so a non-local workspace root cannot be checked.","triggerScenarios":"A workspace whose root resolves to a non-file scheme - e.g. a config/workspace rooted at a remote URL rather than a local directory; unusual embedded/virtual filesystem environments where the root URL lacks a local path.","commonSituations":"Experiments driving deno check against remote-configured workspaces; harnesses running Deno in sandboxes whose cwd/root is not representable as a local path.","solutions":["Run deno check from a local directory with a local deno.json/workspace (the root must map to a real directory)","Clone/download the remote-configured project locally and check it there","If you believe the root is local yet this fires, check for cwd weirdness (deleted directory, exotic mount) and re-run from a stable path"],"exampleFix":"# before: workspace rooted at a remote config\ndeno check --config https://example.com/deno.json src/\n# after: local config\nDeno.writeTextFileSync('deno.json', await (await fetch('https://example.com/deno.json')).text());\ndeno check --config deno.json src/","handlingStrategy":"type-guard","validationCode":"// Verify the workspace root is a local directory before native check\nfunction assertLocalWorkspaceRoot(rootUrl: string) {\n  if (new URL(rootUrl).protocol !== 'file:') {\n    throw new Error(`native check requires a local workspace root: ${rootUrl}`);\n  }\n}","typeGuard":"function isLocalFileUrl(url: string): url is `file://${string}` {\n  try { return new URL(url).protocol === 'file:'; } catch { return false; }\n}","tryCatchPattern":null,"preventionTips":["Run deno check with a local deno.json in a local directory","Vendor remote configs into the repo before type-checking"],"tags":["check","workspace","filesystem","native-tsc"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}