{"record":{"id":"df24f8be043d6d91","repo":"badges/shields","slug":"kind-dependency-not-found","errorCode":null,"errorMessage":"${kind} dependency not found","messagePattern":"(.+?) dependency not found","errorType":"exception","errorClass":"InvalidParameter","httpStatus":null,"severity":"error","filePath":"services/package-json-helpers.js","lineNumber":70,"sourceCode":"  wantedDependency,\n  dependencies,\n  devDependencies,\n  peerDependencies,\n  optionalDependencies,\n}) {\n  const dependencyMaps = {\n    peer: peerDependencies,\n    optional: optionalDependencies,\n    dev: devDependencies,\n    prod: dependencies,\n  }\n\n  if (!(kind in dependencyMaps)) {\n    throw Error(`Not very kind: ${kind}`)\n  }\n  const range = dependencyMaps[kind][wantedDependency]\n  if (range === undefined) {\n    throw new InvalidParameter({\n      prettyMessage: `${kind} dependency not found`,\n    })\n  }\n\n  return range\n}\n\nexport { isDependencyMap, isPackageJsonWithDependencies, getDependencyVersion }\n","sourceCodeStart":52,"sourceCodeEnd":79,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/package-json-helpers.js#L52-L79","documentation":"package-json-helpers.getDependencyVersion looks up a wanted dependency inside the dependency map selected by `kind` (e.g. dependencies, devDependencies, peerDependencies). If the dependency is not present in that map, it throws InvalidParameter with `${kind} dependency not found`. This signals the caller asked for a dependency/version combination that does not exist in the fetched package.json.","triggerScenarios":"Calling a dependency badge with a package name (`wantedDependency`) that is absent from the requested dependency kind's map in the target repo's package.json — e.g. asking for a devDependency that is only a regular dependency.","commonSituations":"Badges pinned to the wrong dependency kind; packages renamed or moved between dependency sections across releases; typos in the dependency name.","solutions":["Check the dependency exists in the specified section of the target repo's package.json and correct the requested name.","If unsure which section holds it, use the badge variant that scans all dependency kinds, or switch the kind parameter.","Verify spelling/casing of the dependency name exactly matches package.json."],"exampleFix":"// before\n/github/dependency/json/user/repo/devDependencies/lodash  (lodash is in dependencies)\n// after\n/github/dependency/json/user/repo/dependencies/lodash","handlingStrategy":"validation","validationCode":"const pkg = require('./package.json')\nconst maps = { dependencies: pkg.dependencies, devDependencies: pkg.devDependencies, peerDependencies: pkg.peerDependencies }\nif (!(wantedDependency in (maps[kind] || {}))) {\n  throw new Error(`${wantedDependency} is not in ${kind}`)\n}","typeGuard":"function dependencyExists(pkg, kind, name) {\n  const map = pkg && pkg[kind]\n  return map != null && typeof map === 'object' && name in map\n}","tryCatchPattern":null,"preventionTips":["Confirm which section (dependencies vs devDependencies vs peerDependencies) actually holds the package","Copy dependency names exactly from package.json","Re-check badges after moving dependencies between sections"],"tags":["bad-input","validation","dependencies","package-json"],"backgroundTag":"invalid-parameter-value","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}