{"record":{"id":"b20475f5a0f6dec8","repo":"badges/shields","slug":"no-releases-found-b20475","errorCode":null,"errorMessage":"no releases found","messagePattern":"no releases found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"services/github/github-downloads.service.js","lineNumber":192,"sourceCode":"    } else if (tag) {\n      const wantedRelease = await this._requestJson({\n        schema: releaseSchema,\n        url: `/repos/${user}/${repo}/releases/tags/${tag}`,\n        httpErrors: httpErrorsFor('repo or release not found'),\n      })\n      releases = [wantedRelease]\n    } else {\n      const allReleases = await this._requestJson({\n        schema: releaseArraySchema,\n        url: `/repos/${user}/${repo}/releases`,\n        options: { searchParams: { per_page: 500 } },\n        httpErrors: httpErrorsFor('repo not found'),\n      })\n      releases = allReleases\n    }\n\n    if (releases.length === 0) {\n      throw new NotFound({ prettyMessage: 'no releases found' })\n    }\n\n    const { downloads } = this.constructor.transform({\n      releases,\n      assetName,\n    })\n\n    return this.constructor.render({\n      tag,\n      assetName,\n      downloads,\n      displayAssetName,\n    })\n  }\n}\n","sourceCodeStart":174,"sourceCodeEnd":208,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/github/github-downloads.service.js#L174-L208","documentation":"The downloads service's handle() fetches all releases (or a specific tagged release's set) and throws NotFound 'no releases found' when the resulting array is empty. Unlike error 103, no filter was involved in this path — the repository simply has no GitHub Releases to compute download totals from. This is a definitive 404-style condition for release-download badges.","triggerScenarios":"Requesting a downloads badge for a repo that uses only git tags without formal GitHub Releases, or for a specific asset/tag that yields zero releases; also when a repo has zero published releases at all.","commonSituations":"Projects distributing binaries via CI artifacts or third-party hosts instead of GitHub Releases; freshly created repos; mistyping the repo name so you hit an empty/template repo.","solutions":["Publish at least one GitHub Release for the repository (Releases > Draft a new release).","Double-check the user/repo slug in the URL points at the intended repository.","Use a different metric badge (e.g. stars) if the project intentionally has no releases."],"exampleFix":"// before\n/service/github/downloads/release/user/repo/total.json  (repo has no releases)\n// after: create a release, or track stars instead\n/service/github/stars/user/repo.json","handlingStrategy":"validation","validationCode":"// ensure the repo has releases before requesting downloads\nconst rels = await fetch('https://api.github.com/repos/OWNER/REPO/releases?per_page=1').then(r => r.json());\nif (!Array.isArray(rels) || rels.length === 0) throw new Error('repository has no GitHub releases');","typeGuard":"function hasReleases(releases) {\n  return Array.isArray(releases) && releases.length > 0 && releases.every(r => r != null && typeof r.tag_name === 'string');\n}","tryCatchPattern":"try {\n  const { downloads } = await getDownloads({ user, repo, assetName });\n} catch (e) {\n  if (e.prettyMessage === 'no releases found') {\n    // render an inactive badge or publish a release first\n  } else throw e;\n}","preventionTips":["Only use download badges for repos that publish GitHub Releases.","Publish a release before advertising download stats.","Verify the user/repo slug is correct; empty repos have no releases."],"tags":["github","not-found","releases","downloads"],"backgroundTag":"no-releases-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}