{"record":{"id":"b1169b017e0c2bb2","repo":"badges/shields","slug":"unknown-badge-style-style","errorCode":null,"errorMessage":"Unknown badge style: '${style}'","messagePattern":"Unknown badge style: '(.+?)'","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"badge-maker/lib/make-badge.js","lineNumber":46,"sourceCode":"  if (format === 'json') {\n    return JSON.stringify({\n      label,\n      message,\n      logoWidth,\n      // Only call normalizeColor for the JSON case: this is handled\n      // internally by toSvgColor in the SVG case.\n      color: normalizeColor(color),\n      labelColor: normalizeColor(labelColor),\n      link: links,\n      name: label,\n      value: message,\n      idSuffix,\n    })\n  }\n\n  const render = badgeRenderers[style]\n  if (!render) {\n    throw new Error(`Unknown badge style: '${style}'`)\n  }\n\n  logoWidth = +logoWidth || (logo ? DEFAULT_LOGO_HEIGHT : 0)\n\n  return stripXmlWhitespace(\n    render({\n      label,\n      message,\n      links,\n      logo,\n      logoWidth,\n      logoSize,\n      logoPadding: logo && label.length ? 3 : 0,\n      color: toSvgColor(color),\n      labelColor: toSvgColor(labelColor),\n      idSuffix,\n    }),\n  )","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/badge-maker/lib/make-badge.js#L28-L64","documentation":"This is a plain Error (not ValidationError) thrown from makeBadge in badge-maker/lib/make-badge.js:46 when the requested style has no registered renderer in badgeRenderers. It fires only if a style value bypassed or post-dates validation — e.g. direct use of internal make-badge.js, or a validation/render table mismatch. Public API users who pass a valid style should never see it.","triggerScenarios":"Importing lib/make-badge.js directly and calling it with style: 'unknown-style'; or a patched/forked validator whose styleValues list is out of sync with badgeRenderers. Public makeBadge() users hit it only if validation was bypassed.","commonSituations":"Reaching into internal modules to skip validation, monkey-patching the renderer table, vendoring a modified copy where style lists diverged, or building a custom style without registering a renderer.","solutions":["Use the public makeBadge() API from badge-maker/lib/index.js, which validates style first","Change style to one of the supported renderers: plastic, flat, flat-square, for-the-badge, social","If you need a custom style, register a renderer in badgeRenderers or render the SVG yourself"],"exampleFix":"// before\nimport makeBadge from 'badge-maker/lib/make-badge.js'\nmakeBadge({ message: 'x', style: 'custom' })\n// after\nimport { makeBadge } from 'badge-maker'\nmakeBadge({ message: 'x', style: 'flat' })","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"import { makeBadge, ValidationError } from 'badge-maker'\ntry {\n  return makeBadge(badge)\n} catch (e) {\n  if (!(e instanceof ValidationError) && /Unknown badge style/.test(e.message)) {\n    return makeBadge({ ...badge, style: 'flat' })\n  }\n  throw e\n}","preventionTips":["Use the public makeBadge() export; do not import lib/make-badge.js directly","Only pass the five documented style values","Do not mutate or patch the internal badgeRenderers table"],"tags":["unknown-value","renderer","internal-api"],"backgroundTag":"unknown-badge-style","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}