{"record":{"id":"86ee863c3e1e550d","repo":"denoland/deno","slug":"unsupported-registry-endpoint-scheme-scheme-e","errorCode":null,"errorMessage":"Unsupported registry endpoint scheme \"{scheme}\". Expected \"http\" or \"https\".","messagePattern":"Unsupported registry endpoint scheme \"(.+?)\"\\. Expected \"http\" or \"https\"\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/lsp/registries.rs","lineNumber":286,"sourceCode":"/// Attempt to parse a URL along with a base, where the base will be used if the\n/// URL requires one.\nfn parse_url_with_base(\n  url: &str,\n  base: &ModuleSpecifier,\n) -> Result<ModuleSpecifier, AnyError> {\n  let url = match Url::parse(url) {\n    Ok(url) => url,\n    Err(ParseError::RelativeUrlWithoutBase) => base.join(url)?,\n    Err(err) => return Err(err.into()),\n  };\n  validate_endpoint_scheme(&url)?;\n  Ok(url)\n}\n\nfn validate_endpoint_scheme(url: &Url) -> Result<(), AnyError> {\n  match url.scheme() {\n    \"http\" | \"https\" => Ok(()),\n    scheme => Err(anyhow!(\n      \"Unsupported registry endpoint scheme \\\"{scheme}\\\". Expected \\\"http\\\" or \\\"https\\\".\"\n    )),\n  }\n}\n\n/// Replaces a variable in a templated URL string with the supplied value or\n/// \"blank\" it out if there is no value supplied.\nfn replace_variable(\n  url: &str,\n  variable: &Key,\n  maybe_value: Option<&str>,\n) -> String {\n  let url_str = url.to_string();\n  let value = maybe_value.unwrap_or(\"\");\n  if let StringOrNumber::String(name) = &variable.name {\n    url_str\n      .replace(&format!(\"${{{name}}}\"), value)\n      .replace(&format! {\"${{{{{name}}}}}\"}, value)","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/lsp/registries.rs#L268-L304","documentation":"This error is thrown by `validate_endpoint_scheme` in cli/lsp/registries.rs when a configured registry endpoint URL uses a scheme other than `http` or `https`. The LSP registry integration only supports HTTP(S) endpoints, so URLs like `file://`, `ftp://`, or typos like `htps://` are rejected. It is invoked while parsing registry URLs (`parse_url_with_base`) and fetching endpoint documentation (`get_documentation`).","triggerScenarios":"Configuring a Deno LSP registry (e.g. in deno.json `\"registry\"` settings) with an endpoint URL whose scheme is not http/https, such as `file:///...`, `ftp://...`, or a mistyped scheme; the error surfaces when the LSP parses the URL or fetches documentation.","commonSituations":"Typos in the scheme (\"htps://\", missing 'p'), pointing a registry at a local file path with file://, or copying a custom registry URL from internal tooling that uses a non-HTTP protocol.","solutions":["Change the endpoint URL scheme to `https://` (preferred) or `http://` in your deno.json registry configuration.","Fix typos in the scheme, e.g. \"htps\" -> \"https\".","If using a local registry, serve it over HTTP locally (e.g. `http://localhost:8080`) instead of file://."],"exampleFix":"// deno.json\n// before\n{ \"registry\": { \"endpoints\": [\"file:///registry/${module}.json\"] } }\n// after\n{ \"registry\": { \"endpoints\": [\"http://localhost:8080/registry/${module}.json\"] } }","handlingStrategy":"validation","validationCode":"const url = new URL(endpoint);\nif (url.protocol !== \"http:\" && url.protocol !== \"https:\") {\n  throw new Error(`Registry endpoint \"${endpoint}\" must use http or https, got \"${url.protocol.replace(\":\", \"\")}\"`);\n}","typeGuard":"function isHttpEndpoint(endpoint: string): boolean {\n  try {\n    const u = new URL(endpoint);\n    return u.protocol === \"http:\" || u.protocol === \"https:\";\n  } catch {\n    return false;\n  }\n}","tryCatchPattern":"try {\n  await registry.getDocumentation(endpointUrl);\n} catch (err) {\n  if (String(err.message).includes(\"Unsupported registry endpoint scheme\")) {\n    console.error(`Endpoint \"${endpointUrl}\" must be http(s); check for typos like 'htps://' or file:// paths.`);\n  } else {\n    throw err;\n  }\n}","preventionTips":["Always use https:// for registry endpoints in deno.json.","Double-check for scheme typos ('htps', missing colon-slashes) when configuring registries.","Serve local/private registries over http://localhost instead of file:// paths."],"tags":["lsp","registry","url-scheme","configuration"],"backgroundTag":"unsupported-url-scheme","analyzedSha":"f7822238cab635a3a19f99f493f675fa81a7f9d8","analyzedAt":"2026-08-29T08:55:39.519Z","contentChangedAt":"2026-08-29T08:55:39.519Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}