{"record":{"id":"3a4b6abb9758a298","repo":"denoland/deno","slug":"deno-autoupdate-no-version-in-deno-json-skipping","errorCode":null,"errorMessage":"Deno.autoUpdate: no version in deno.json, skipping","messagePattern":"Deno\\.autoUpdate: no version in deno\\.json, skipping","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/rt/desktop.rs","lineNumber":1081,"sourceCode":"      : (urlOrOpts ?? {{}});\n    const {{\n      url = _releaseBaseUrl,\n      interval,\n      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 {{","sourceCodeStart":1063,"sourceCodeEnd":1099,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/rt/desktop.rs#L1063-L1099","documentation":"Deno.autoUpdate() is injected into desktop apps (cli/rt/desktop.rs) to check an HTTPS release feed for updates. The current app version is baked in at build time from the root deno.json's `version` field; when that field is absent, _version is null and the function logs this console.warn and returns without checking for updates. It is a skip notice, not a crash — auto-update is silently disabled.","triggerScenarios":"Building a desktop app (`deno compile --desktop`) from a project whose root deno.json has no `\"version\"` field, then running the binary — Deno.autoUpdate() (or its timer) warns immediately and never polls for updates.","commonSituations":"Prototypes/early apps whose deno.json only has name/tasks/imports; adding autoUpdate({ url, publicKey }) after the fact without adding a version; monorepos where the root deno.json is a workspace manifest without a version and the desktop package config lives elsewhere.","solutions":["Add a semver `\"version\"` field to the root deno.json (e.g. \"version\": \"1.0.0\") and rebuild the desktop binary — the value is baked in at compile time.","Bump that version in CI/release so the updater can detect newer releases.","Verify after rebuild by launching the app: the warning should no longer appear when Deno.autoUpdate runs.","Pass an explicit release url and publicKey so that, once versioned, the update flow is fully configured."],"exampleFix":"// before: deno.json\n{\n  \"name\": \"my-app\",\n  \"tasks\": { \"dev\": \"deno desktop .\" }\n}\n\n// after\n{\n  \"name\": \"my-app\",\n  \"version\": \"1.0.0\",\n  \"tasks\": { \"dev\": \"deno desktop .\" }\n}","handlingStrategy":"validation","validationCode":"// pre-build check (CI): fail if a desktop build has no version\nconst cfg = JSON.parse(Deno.readTextFileSync(\"deno.json\"));\nif (!cfg.version) {\n  throw new Error(\"deno.json is missing \\\"version\\\"; auto-update will be skipped\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set \"version\" in the root deno.json before the first `deno compile --desktop` build — it is baked in at compile time.","Bump the version as part of the release pipeline so auto-update can detect new releases.","Smoke-test a built binary and assert the \"no version in deno.json\" warning does not appear."],"tags":["desktop","auto-update","version","deno-json","build-config"],"backgroundTag":"missing-app-version","analyzedSha":"f7822238cab635a3a19f99f493f675fa81a7f9d8","analyzedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-08-31T04:17:50.494Z"}