{"record":{"id":"41fe776b3e179452","repo":"denoland/deno","slug":"the-bench-function-must-have-a-name","errorCode":null,"errorMessage":"The bench function must have a name","messagePattern":"The bench function must have a name","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"cli/js/40_bench.js","lineNumber":143,"sourceCode":"        throw new TypeError(\n          \"Unexpected 'fn' field in options, bench function is already provided as the third argument\",\n        );\n      }\n      if (optionsOrFn.name != undefined) {\n        throw new TypeError(\n          \"Unexpected 'name' field in options, bench name is already provided as the first argument\",\n        );\n      }\n      benchDesc = {\n        ...defaults,\n        ...optionsOrFn,\n        fn: maybeFn,\n        name: nameOrFnOrOptions,\n      };\n    }\n  } else if (typeof nameOrFnOrOptions === \"function\") {\n    if (!nameOrFnOrOptions.name) {\n      throw new TypeError(\"The bench function must have a name\");\n    }\n    if (optionsOrFn != undefined) {\n      throw new TypeError(\"Unexpected second argument to Deno.bench()\");\n    }\n    if (maybeFn != undefined) {\n      throw new TypeError(\"Unexpected third argument to Deno.bench()\");\n    }\n    benchDesc = {\n      ...defaults,\n      fn: nameOrFnOrOptions,\n      name: nameOrFnOrOptions.name,\n    };\n  } else {\n    let fn;\n    let name;\n    if (typeof optionsOrFn === \"function\") {\n      fn = optionsOrFn;\n      if (nameOrFnOrOptions.fn != undefined) {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/js/40_bench.js#L125-L161","documentation":"On Linux, deep-link registration rewrites the `.desktop` entry inside the application bundle: it appends `x-scheme-handler/<scheme>;` MIME types and ensures `Exec=` forwards the opened URL via the `%u` field code. This error means the bundle directory contains no file with a `.desktop` extension to patch.","triggerScenarios":"The Linux deep-link registration step running against a bundle directory whose packaging produced no `.desktop` entry, or one that was renamed, moved, or deleted after packaging.","commonSituations":"A custom/simplified packaging step that skips desktop integration; stale or partially deleted build output from an earlier run; a laufey backend archive whose on-disk layout differs from what this Deno expects.","solutions":["Rebuild the bundle from a clean state so the packaging step regenerates the `.desktop` file","Inspect the printed bundle path and confirm a `*.desktop` file exists; restore or rename it if it was altered","Verify the backend/target combination actually ships Linux desktop integration; try the default target","If the cached backend download may be stale, clear the laufey cache dir and re-run so it re-downloads and re-extracts"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for (const e of Deno.readDirSync(bundleDir)) {\n  if (e.isFile && e.name.endsWith('.desktop')) return; // ok, registration can proceed\n}\nthrow new Error(`no .desktop file in ${bundleDir} — rebuild the bundle`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the packaging step that emits the .desktop entry in every Linux bundle pipeline","Run deep-link registration only against freshly built bundle output","Add a post-packaging assertion that the bundle contains a .desktop file"],"tags":["desktop","linux","deep-links","bundle","desktop-file"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}