{"record":{"id":"5d0f14b3e9576385","repo":"oven-sh/bun","slug":"hit-condition-is-not-a-number","errorCode":null,"errorMessage":"Hit condition is not a number.","messagePattern":"Hit condition is not a number\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bun-debug-adapter-protocol/src/debugger/adapter.ts","lineNumber":2478,"sourceCode":"        data: logMessageToExpression(logMessage),\n        emulateUserGesture: true,\n      },\n    ],\n  };\n}\n\nfunction hitConditionToIgnoreCount(hitCondition?: string): number | undefined {\n  if (!hitCondition) {\n    return undefined;\n  }\n\n  if (hitCondition.includes(\"<\")) {\n    throw new Error(\"Hit condition with '<' is not supported, use '>' or '>=' instead.\");\n  }\n\n  const count = parseInt(hitCondition.replace(/[^\\d+]/g, \"\"));\n  if (isNaN(count)) {\n    throw new Error(\"Hit condition is not a number.\");\n  }\n\n  if (hitCondition.includes(\">\") && !hitCondition.includes(\"=\")) {\n    return Math.max(0, count);\n  }\n  return Math.max(0, count - 1);\n}\n\nfunction logMessageToExpression(logMessage?: string): string | undefined {\n  if (!logMessage) {\n    return undefined;\n  }\n  // Convert expressions from \"hello {name}!\" to \"`hello ${name}!`\"\n  return `console.log(\\`${logMessage.replace(/\\$?{/g, \"${\")}\\`);`;\n}\n\nfunction completionToExpression(completion: string): { expression: string; hint?: string } {\n  const lastDot = completion.lastIndexOf(\".\");","sourceCodeStart":2460,"sourceCodeEnd":2496,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/packages/bun-debug-adapter-protocol/src/debugger/adapter.ts#L2460-L2496","documentation":"Error \"Hit condition is not a number.\" thrown in oven-sh/bun.","triggerScenarios":"Thrown at packages/bun-debug-adapter-protocol/src/debugger/adapter.ts:2478 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}