{"record":{"id":"78b413b33617c299","repo":"oven-sh/bun","slug":"unknown-target-target-targetline-file-f","errorCode":null,"errorMessage":"Unknown target ${target}\n> ${targetLine}\n file:${file}","messagePattern":"Unknown target (.+?)\n> (.+?)\n file:(.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"bench/snippets/runner-entrypoint.js","lineNumber":47,"sourceCode":"    return;\n  }\n\n  const targetLine = sourceContents.slice(targetLineStart, targetLineEnd);\n  const targets = targetLine\n    .slice(\"// @runtime \".length)\n    .split(/[,\\s]+/gm)\n    .map(a => a.trim().toLowerCase())\n    .filter(Boolean)\n    .sort();\n\n  if (targets.length === 0) {\n    throw new TypeError(\"No targets specified in \" + JSON.stringify(file) + \"\\n> \" + JSON.stringify(targetLine) + \"\\n\");\n  }\n\n  var cmds = {};\n  for (let target of targets) {\n    if (!(target in runtimes)) {\n      throw new TypeError(\n        \"Unknown target \" + JSON.stringify(target) + \"\\n> \" + targetLine + \"\\n file:\" + JSON.stringify(file),\n      );\n    }\n\n    switch (target) {\n      case \"bun\": {\n        if (!runtimes.bun) {\n          continue;\n        }\n\n        cmds.bun = [runtimes.bun, \"run\", file];\n        break;\n      }\n\n      case \"node\": {\n        if (!runtimes.node) {\n          continue;\n        }","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/bench/snippets/runner-entrypoint.js#L29-L65","documentation":"Configuration error from the benchmark runner: a '// @runtime' directive parsed successfully, but one of its target names is not a key of the runner's `runtimes` map, which only contains bun, node, and deno. The error includes the offending target, the full directive line, and the file. Names are trimmed and lowercased before the lookup, so only genuinely unknown/misspelled names reach this throw.","triggerScenarios":"A directive like '// @runtime bun,nodejs' (typo), '// @runtime v8' or any name outside {bun, node, deno}. Note this is about the name, not availability: a known-but-uninstalled runtime (node/deno not found) is skipped silently — only unknown names throw.","commonSituations":"Typos in the runtime list; targeting a runtime the runner has never heard of (workers, chrome, etc.); copy-pasting directives from a different harness.","solutions":["Check the target name quoted in the error and correct it to bun, node, or deno","If you need a new runtime, extend the `runtimes` map at the top of bench/snippets/runner-entrypoint.js and its switch statement","Re-run the runner after fixing the directive"],"exampleFix":"// before\n// @runtime bun,nodej\n\n// after\n// @runtime bun,node\n","handlingStrategy":"validation","validationCode":"const KNOWN_TARGETS = new Set(['bun', 'node', 'deno']);\nconst targets = runtimeLine.slice('// @runtime '.length).split(/[,\\s]+/).map(s => s.trim().toLowerCase()).filter(Boolean);\nconst bad = targets.filter(t => !KNOWN_TARGETS.has(t));\nif (bad.length) throw new TypeError('Unsupported runtime target(s): ' + bad.join(', '));","typeGuard":"function isKnownTarget(name) {\n  return ['bun', 'node', 'deno'].includes(name.trim().toLowerCase());\n}","tryCatchPattern":null,"preventionTips":["Restrict runtime lists to the names in the runtimes map at the top of runner-entrypoint.js: bun, node, deno","When adding a new runtime to the runner, update both the map and the switch before any snippet references it","Note that an installed-but-missing runtime (no node/deno binary) is skipped silently — only misspelled names throw, so check the quoted name carefully"],"tags":["benchmark","runner","configuration","typo"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}