badges/shields · error · Error

Not very kind: ${kind}

Error message

Not very kind: ${kind}

What it means

getDependencyVersion in services/pipenv-helpers.js resolves a package version from a Pipfile.lock. The lockfile splits dependencies into 'develop' and 'default' sections, and this error is thrown when the caller passes a kind that is neither of those two strings. It is an internal guard against unsupported dependency kinds, thrown as a plain Error rather than a structured InvalidParameter.

Source

Thrown at services/pipenv-helpers.js:59

 * @param {string} attrs.wantedDependency - Name of the wanted dependency
 * @param {object} attrs.lockfileData - Object containing lock file data
 * @throws {Error} - Error if unknown dependency type provided
 * @throws {InvalidParameter} - Error if wanted dependency is not present in lock file data
 * @throws {InvalidParameter} - Error if version or ref is not present for the wanted dependency
 * @returns {object} Object containing wanted dependency version or ref
 */
function getDependencyVersion({
  kind = 'default',
  wantedDependency,
  lockfileData,
}) {
  let dependenciesOfKind
  if (kind === 'dev') {
    dependenciesOfKind = lockfileData.develop
  } else if (kind === 'default') {
    dependenciesOfKind = lockfileData.default
  } else {
    throw Error(`Not very kind: ${kind}`)
  }

  if (!(wantedDependency in dependenciesOfKind)) {
    throw new InvalidParameter({
      prettyMessage: `${kind} dependency not found`,
    })
  }

  const { version, ref } = dependenciesOfKind[wantedDependency]

  if (version) {
    // Strip the `==` which is always present.
    return { version: version.replace('==', '') }
  } else if (ref) {
    if (ref.length === 40) {
      // assume it is a commit hash
      return { ref: ref.substring(0, 7) }
    }

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Change the caller to pass exactly 'dev' or 'default' as the kind argument
  2. If a user-supplied kind is involved, validate/normalize it before calling (e.g. map 'develop'->'dev', reject others)
  3. If a new lockfile section needs support, extend the if/else chain in getDependencyVersion instead of passing an unmapped value

Example fix

// before
const deps = getDependencyVersion(lockfile, pkg, 'develop')
// after
const deps = getDependencyVersion(lockfile, pkg, 'dev')
Defensive patterns

Strategy: validation

Validate before calling

const VALID_KINDS = ['dev', 'default']
if (!VALID_KINDS.includes(kind)) {
  throw new Error(`Invalid dependency kind: ${kind} (expected 'dev' or 'default')`)
}

Type guard

function isDependencyKind(kind) {
  return kind === 'dev' || kind === 'default'
}

Try / catch

try {
  const version = getDependencyVersion(lockfile, pkg, kind)
} catch (err) {
  if (err.message.startsWith('Not very kind:')) {
    // normalize alias or surface a friendly message
    kind = kind === 'develop' ? 'dev' : 'default'
  } else throw err
}

Prevention

When it happens

Trigger: Calling getDependencyVersion(lockfileData, wantedDependency, kind) with kind not exactly 'dev' or 'default' — e.g. passing 'development', 'both', undefined, or a user-supplied kind string from config.

Common situations: Wiring a badge/service to pipenv-helpers with a hand-written kind argument; a config file where users can specify which dependency section to query; refactoring that renamed 'dev' to 'develop' in a caller but not in getDependencyVersion.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30). Data as JSON: /api/errors/492d21309586210e. Report an issue: GitHub.