{"record":{"id":"7ae7aa4f97b49072","repo":"badges/shields","slug":"no-languages-found","errorCode":null,"errorMessage":"no languages found","messagePattern":"no languages found","errorType":"exception","errorClass":"InvalidResponse","httpStatus":424,"severity":"warning","filePath":"services/gitlab/gitlab-top-language.service.js","lineNumber":76,"sourceCode":"\n  async fetch({ project, baseUrl }) {\n    return super.fetch({\n      schema,\n      url: `${baseUrl}/api/v4/projects/${encodeURIComponent(project)}/languages`,\n      httpErrors: httpErrorsFor('project not found'),\n    })\n  }\n\n  async handle({ project }, { gitlab_url: baseUrl = 'https://gitlab.com' }) {\n    const languageData = await this.fetch({\n      project,\n      baseUrl,\n    })\n\n    if (Object.keys(languageData).length > 0) {\n      return this.constructor.render({ languageData })\n    } else {\n      throw new InvalidResponse({ prettyMessage: 'no languages found' })\n    }\n  }\n}\n","sourceCodeStart":58,"sourceCodeEnd":80,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/gitlab/gitlab-top-language.service.js#L58-L80","documentation":"The GitLab top-language service throws this InvalidResponse when the GitLab languages API returns an empty object, i.e. GitLab reports zero language statistics for the repository. The service cannot determine a dominant language, so it raises a 'no languages found' response error.","triggerScenarios":"Requesting the language badge for an empty repository, a repo containing only file types GitLab cannot classify (no code files indexed yet), or a project whose language stats have not been computed by the linguist job.","commonSituations":"Freshly created repos with only README or empty files; repos with only documents/images; GitLab still processing the first push so the languages endpoint returns {} temporarily.","solutions":["Push actual source code files so GitLab's linguist can detect languages","Wait for GitLab to finish computing language stats after the first push (can take a few minutes)","Verify the badge URL targets the intended, populated repository","If the repo legitimately has no detectable code, remove the language badge"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const langs = await (await fetch(`https://gitlab.com/api/v4/projects/${encodeURIComponent(project)}/languages`)).json()\nif (!langs || Object.keys(langs).length === 0) console.warn('GitLab reports no language stats yet')","typeGuard":"const hasLanguages = (l) => l != null && typeof l === 'object' && Object.keys(l).length > 0","tryCatchPattern":"try {\n  const rendered = await service.handle({ project })\n} catch (e) {\n  if (e.prettyMessage === 'no languages found') {\n    // render generic 'no languages' badge\n  } else throw e\n}","preventionTips":["Push real source files before adding a language badge","Allow a few minutes after the first push for GitLab to compute stats","Verify the repo is not empty before embedding the badge"],"tags":["gitlab","languages","empty-response","invalid-response"],"backgroundTag":"empty-api-response","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}