badges/shields · warning · InvalidResponse
no languages found
Error message
no languages found
What it means
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.
Source
Thrown at services/gitlab/gitlab-top-language.service.js:76
async fetch({ project, baseUrl }) {
return super.fetch({
schema,
url: `${baseUrl}/api/v4/projects/${encodeURIComponent(project)}/languages`,
httpErrors: httpErrorsFor('project not found'),
})
}
async handle({ project }, { gitlab_url: baseUrl = 'https://gitlab.com' }) {
const languageData = await this.fetch({
project,
baseUrl,
})
if (Object.keys(languageData).length > 0) {
return this.constructor.render({ languageData })
} else {
throw new InvalidResponse({ prettyMessage: 'no languages found' })
}
}
}
View on GitHub (pinned to 766fd8bc89)
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
Defensive patterns
Strategy: validation
Validate before calling
const langs = await (await fetch(`https://gitlab.com/api/v4/projects/${encodeURIComponent(project)}/languages`)).json()
if (!langs || Object.keys(langs).length === 0) console.warn('GitLab reports no language stats yet') Type guard
const hasLanguages = (l) => l != null && typeof l === 'object' && Object.keys(l).length > 0
Try / catch
try {
const rendered = await service.handle({ project })
} catch (e) {
if (e.prettyMessage === 'no languages found') {
// render generic 'no languages' badge
} else throw e
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- no commits found
- invalid response data from auth endpoint
- unparseable svg response
- unparseable toml response
- unparseable xml response
AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30).
Data as JSON: /api/errors/7ae7aa4f97b49072.
Report an issue: GitHub.