{"record":{"id":"b05e594c03b6f7c6","repo":"badges/shields","slug":"package-not-found-b05e59","errorCode":null,"errorMessage":"package not found","messagePattern":"package not found","errorType":"exception","errorClass":"InvalidParameter","httpStatus":null,"severity":"error","filePath":"services/winget/winget-base.js","lineNumber":112,"sourceCode":"            object(expression: $expression) {\n              ... on Blob {\n                text\n              }\n            }\n          }\n        }\n      `,\n      variables: { expression },\n      schema: manifestSchema,\n      transformErrors,\n    })\n  }\n\n  // Returns the latest version string for a package, or throws if not found.\n  async getLatestVersion({ name }) {\n    const json = await this.fetchVersions({ name })\n    if (json.data.repository.object?.entries == null) {\n      throw new InvalidParameter({ prettyMessage: 'package not found' })\n    }\n    const entries = json.data.repository.object.entries\n    const directories = entries.filter(entry => entry.type === 'tree')\n    const versionDirs = directories.filter(dir =>\n      dir.object.entries.some(\n        file => file.type === 'blob' && file.name === `${name}.yaml`,\n      ),\n    )\n    const version = latest(versionDirs.map(dir => dir.name))\n    if (version == null) {\n      throw new InvalidParameter({ prettyMessage: 'no versions found' })\n    }\n    return version\n  }\n}\n","sourceCodeStart":94,"sourceCodeEnd":128,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/winget/winget-base.js#L94-L128","documentation":"The winget base service throws InvalidParameter 'package not found' when the GitHub GraphQL query against microsoft/winget-pkgs returns no repository object entries, meaning no manifest directory exists for the requested package name.","triggerScenarios":"Calling getLatestVersion with a package id that does not exist in the winget-pkgs repository, e.g. wrong publisher prefix or a package never packaged for winget.","commonSituations":"Using display name instead of the winget package id, missing publisher segment (e.g. 'Git.Git' vs 'Git'), package removed from winget, package available only in a custom source.","solutions":["Run 'winget search <name>' or check the Microsoft community repository to get the exact package id","Use the full case-correct id like 'VideoLAN.VLC' rather than the app name","If the package is only in a custom source, this badge (community repo based) will not find it","Remove or replace the badge if the package is not in winget"],"exampleFix":"// before\ngetLatestVersion({ name: 'vlc' })\n// after\ngetLatestVersion({ name: 'VideoLAN.VLC' })","handlingStrategy":"validation","validationCode":"// check the package id exists in the winget community repo before rendering\nconst res = await fetch(`https://github.com/microsoft/winget-pkgs/tree/master/manifests/${id.replace('.', '/')}`)\nif (!res.ok) throw new Error(`winget package not found: ${id}`);","typeGuard":"function hasWingetEntries(json) { return json?.data?.repository?.object?.entries != null }","tryCatchPattern":"try {\n  const version = await service.getLatestVersion({ name })\n} catch (e) {\n  if (e.message === 'package not found') {\n    // fallback: display 'unknown' or use 'winget search' to find the right id\n  } else throw e\n}","preventionTips":["Always use the full winget package id (Publisher.App), not the display name","Confirm the id with 'winget search' or the winget-pkgs repo first","Remember custom/enterprise winget sources are not covered by this badge"],"tags":["not-found","package","winget","github-api"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}