{"record":{"id":"b94be6fb5ed06d23","repo":"badges/shields","slug":"kind-dependency-not-found-b94be6","errorCode":null,"errorMessage":"${kind} dependency not found","messagePattern":"(.+?) dependency not found","errorType":"validation","errorClass":"InvalidParameter","httpStatus":null,"severity":"error","filePath":"services/pipenv-helpers.js","lineNumber":63,"sourceCode":" * @throws {InvalidParameter} - Error if version or ref is not present for the wanted dependency\n * @returns {object} Object containing wanted dependency version or ref\n */\nfunction getDependencyVersion({\n  kind = 'default',\n  wantedDependency,\n  lockfileData,\n}) {\n  let dependenciesOfKind\n  if (kind === 'dev') {\n    dependenciesOfKind = lockfileData.develop\n  } else if (kind === 'default') {\n    dependenciesOfKind = lockfileData.default\n  } else {\n    throw Error(`Not very kind: ${kind}`)\n  }\n\n  if (!(wantedDependency in dependenciesOfKind)) {\n    throw new InvalidParameter({\n      prettyMessage: `${kind} dependency not found`,\n    })\n  }\n\n  const { version, ref } = dependenciesOfKind[wantedDependency]\n\n  if (version) {\n    // Strip the `==` which is always present.\n    return { version: version.replace('==', '') }\n  } else if (ref) {\n    if (ref.length === 40) {\n      // assume it is a commit hash\n      return { ref: ref.substring(0, 7) }\n    }\n    return { ref } // tag\n  } else {\n    throw new InvalidParameter({\n      prettyMessage: `No version or ref for ${wantedDependency}`,","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/pipenv-helpers.js#L45-L81","documentation":"This InvalidParameter error is thrown by getDependencyVersion in pipenv-helpers when the wanted dependency is not present under the requested kind ('default' or 'dev') in the parsed Pipfile.lock data. The lockfile was valid and parsed, but that package is simply not listed in that section.","triggerScenarios":"Requesting a dependency badge for a package not in the Pipfile.lock section matching the kind: it is in 'develop' while kind='default', it was removed from the lockfile, or the name casing/key does not match the lockfile key.","commonSituations":"Badges pointing at dependencies that were removed from the project; mixing up default vs dev dependencies; lockfile regenerated without the package.","solutions":["Check Pipfile.lock and confirm the package key exists under the correct section ('default' or 'develop') and request it with the matching kind","Regenerate the lockfile with `pipenv lock` if it is stale","Fix the dependency name in the badge URL (Pipfile.lock keys are normalized package names)","Remove the badge if the dependency was intentionally dropped"],"exampleFix":"// before\nGET /pipenv/dependents/repo/pytest/default  (pytest only in develop)\n// after\nGET /pipenv/dependents/repo/pytest/dev","handlingStrategy":"validation","validationCode":"const lock = JSON.parse(fs.readFileSync('Pipfile.lock', 'utf8'))\nconst section = kind === 'dev' ? lock.develop : lock.default\nif (!section || !(wantedDependency in section)) throw new Error(`${wantedDependency} not found in Pipfile.lock section '${kind}'`)","typeGuard":"function isInLockfileSection(lockData, dep, kind) {\n  const section = kind === 'dev' ? lockData?.develop : lockData?.default\n  return typeof section === 'object' && section !== null && dep in section\n}","tryCatchPattern":"try {\n  const v = await getDependencyVersion({ kind, wantedDependency }, lockfileData)\n} catch (e) {\n  if (e instanceof InvalidParameter && e.message.includes('dependency not found')) console.warn(`Check Pipfile.lock: ${wantedDependency} missing from ${kind} section`)\n  else throw e\n}","preventionTips":["Confirm the dependency's section (default vs develop) before choosing the badge kind","Regenerate Pipfile.lock after dependency changes so badges stay in sync","Use the exact normalized package name from the lockfile key"],"tags":["pipenv","python","dependency","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}