oven-sh/bun · error · Error

Hit condition with '<' is not supported, use '>' or '>='…

Error message

Hit condition with '<' is not supported, use '>' or '>=' instead.

What it means

hitConditionToIgnoreCount: DAP hit conditions containing '<' cannot be expressed as an ignore-count (which only skips the first N hits), so the breakpoint configuration is rejected instead of silently misbehaving.

Solutions

  1. Use a '>' or '>=' hit condition instead of '<'
  2. Express '< N' semantics via a conditional breakpoint expression
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/bun-debug-adapter-protocol/src/debugger/adapter.ts:2473 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/9f974906a721c6df. Report an issue: GitHub.

Appendix: source

Thrown at packages/bun-debug-adapter-protocol/src/debugger/adapter.ts:2473

    ignoreCount: hitConditionToIgnoreCount(hitCondition),
    autoContinue: !!logMessage,
    actions: [
      {
        type: "evaluate",
        data: logMessageToExpression(logMessage),
        emulateUserGesture: true,
      },
    ],
  };
}

function hitConditionToIgnoreCount(hitCondition?: string): number | undefined {
  if (!hitCondition) {
    return undefined;
  }

  if (hitCondition.includes("<")) {
    throw new Error("Hit condition with '<' is not supported, use '>' or '>=' instead.");
  }

  const count = parseInt(hitCondition.replace(/[^\d+]/g, ""));
  if (isNaN(count)) {
    throw new Error("Hit condition is not a number.");
  }

  if (hitCondition.includes(">") && !hitCondition.includes("=")) {
    return Math.max(0, count);
  }
  return Math.max(0, count - 1);
}

function logMessageToExpression(logMessage?: string): string | undefined {
  if (!logMessage) {
    return undefined;
  }
  // Convert expressions from "hello {name}!" to "`hello ${name}!`"

View on GitHub (pinned to 8c5296ac45)