{"record":{"id":"6622bea9281fd39b","repo":"denoland/deno","slug":"deno-autoupdate-missing-url-option-skipping","errorCode":null,"errorMessage":"Deno.autoUpdate: missing 'url' option, skipping","messagePattern":"Deno\\.autoUpdate: missing 'url' option, skipping","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/rt/desktop.rs","lineNumber":1085,"sourceCode":"      onUpdateReady,\n      onRollback,\n      publicKey,\n    }} = opts;\n\n    if (_rolledBack && typeof onRollback === \"function\") {{\n      queueMicrotask(() => {{\n        try {{ onRollback(ROLLBACK_REASON); }} catch (e) {{\n          console.error(\"Deno.autoUpdate onRollback threw:\", e);\n        }}\n      }});\n    }}\n\n    if (!_version) {{\n      console.warn(\"Deno.autoUpdate: no version in deno.json, skipping\");\n      return;\n    }}\n    if (typeof url !== \"string\" || url.length === 0) {{\n      console.warn(\"Deno.autoUpdate: missing 'url' option, skipping\");\n      return;\n    }}\n    if (!isHttpsUrl(url)) {{\n      console.error(\n        \"Deno.autoUpdate: refusing non-https url (got %s); ignoring.\", url,\n      );\n      return;\n    }}\n\n    const base = url.replace(/\\/$/, \"\");\n    const te = new TextEncoder();\n\n    const check = async () => {{\n      try {{\n        const resp = await fetch(base + \"/latest.json\", {{\n          cache: \"no-store\",\n          redirect: \"error\",\n        }});","sourceCodeStart":1067,"sourceCodeEnd":1103,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/rt/desktop.rs#L1067-L1103","documentation":"Deno.autoUpdate() is the desktop-build auto-update hook injected by cli/rt/desktop.rs. Before starting update checks it requires a non-empty string url, defaulting to the release_base_url baked in at compile time. When that default is empty and the caller passed no usable url, the runtime logs this warning and silently skips all update checks. It is a configuration gap, not a crash: the app keeps running on its current version.","triggerScenarios":"Calling Deno.autoUpdate() with no arguments in a desktop binary that was compiled without a release_base_url; calling Deno.autoUpdate({ url: \"\" }); or passing a url that is not a plain string (e.g., a URL instance or number), because only typeof url === \"string\" passes the guard at cli/rt/desktop.rs:1013.","commonSituations":"CI packaging pipelines that omit the release-base-url build flag; refactors that start passing a URL object instead of a string; early prototyping before an update server exists.","solutions":["Pass an explicit https url string: Deno.autoUpdate({ url: \"https://updates.example.com/myapp\" })","If the url should be implicit, compile/package the desktop binary with a non-empty release_base_url so the default resolves","Make sure the url option is a plain string, not a URL instance (URL objects fail the typeof check)","Confirm version is set in deno.json at build time; without it autoUpdate skips even earlier with a different warning"],"exampleFix":"// before\nDeno.autoUpdate(); // desktop build compiled without release_base_url\n\n// after\nDeno.autoUpdate({ url: \"https://updates.example.com/myapp\", interval: 3_600_000 });","handlingStrategy":"validation","validationCode":"// fail loudly instead of letting autoUpdate silently skip\nconst opts = typeof cfg === \"string\" ? { url: cfg } : (cfg ?? {});\nif (typeof opts.url !== \"string\" || opts.url.length === 0) {\n  throw new Error(\"Deno.autoUpdate: explicit https url required (no baked-in release_base_url)\");\n}\nif (!opts.url.startsWith(\"https://\")) {\n  throw new Error(`Deno.autoUpdate: refusing non-https url: ${opts.url}`);\n}\nDeno.autoUpdate(opts);","typeGuard":"function hasAutoUpdateUrl(o: unknown): o is { url: string } {\n  return typeof o === \"object\" && o !== null &&\n    typeof (o as { url?: unknown }).url === \"string\" &&\n    (o as { url: string }).url.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Compile desktop builds with release_base_url so the default url is never empty","Always pass url as a plain string; URL instances fail the typeof check","Set version in deno.json at build time; autoUpdate skips entirely without it"],"tags":["desktop","auto-update","configuration","missing-option"],"backgroundTag":"missing-required-option","analyzedSha":"f7822238cab635a3a19f99f493f675fa81a7f9d8","analyzedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-08-31T04:17:50.494Z"}