{"record":{"id":"53d16d74784e79a0","repo":"denoland/deno","slug":"unexpected-fn-field-in-options-bench-function-i-53d16d","errorCode":null,"errorMessage":"Unexpected 'fn' field in options, bench function is already provided as the second argument","messagePattern":"Unexpected 'fn' field in options, bench function is already provided as the second argument","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"cli/js/40_bench.js","lineNumber":162,"sourceCode":"    }\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) {\n        throw new TypeError(\n          \"Unexpected 'fn' field in options, bench function is already provided as the second argument\",\n        );\n      }\n      name = nameOrFnOrOptions.name ?? fn.name;\n    } else {\n      if (\n        !nameOrFnOrOptions.fn || typeof nameOrFnOrOptions.fn !== \"function\"\n      ) {\n        throw new TypeError(\n          \"Expected 'fn' field in the first argument to be a bench function\",\n        );\n      }\n      fn = nameOrFnOrOptions.fn;\n      name = nameOrFnOrOptions.name ?? fn.name;\n    }\n    if (!name) {\n      throw new TypeError(\"The bench name can't be empty\");\n    }","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/js/40_bench.js#L144-L180","documentation":"The desktop icon file exists but its extension is neither `.icns` nor `.png` — the only formats accepted by the laufey `NSImage initWithContentsOfFile:` path used here, so no conversion is attempted and startup aborts.","triggerScenarios":"Passing `.jpg`, `.jpeg`, `.svg`, `.ico`, `.webp`, or an extensionless file as the desktop icon on macOS.","commonSituations":"Reusing a web favicon (.ico/.svg), marketing photo (.jpg), or design-tool export (.webp) as the app icon.","solutions":["Convert the image to PNG, e.g. `magick assets/logo.svg assets/logo.png`","Or convert to `.icns` if you want the macOS native format","Point the `icon` config at the converted `.png`/`.icns` file"],"exampleFix":"// before\n\"icon\": \"assets/logo.svg\"\n\n// after\n// $ magick assets/logo.svg assets/logo.png\n\"icon\": \"assets/logo.png\"","handlingStrategy":"validation","validationCode":"const ext = iconPath.split('.').pop()?.toLowerCase();\nif (ext !== 'png' && ext !== 'icns') {\n  throw new Error(`icon must be .png or .icns, got .${ext}`);\n}","typeGuard":"function isSupportedIcon(p: string): boolean {\n  return /\\.(png|icns)$/i.test(p);\n}","tryCatchPattern":null,"preventionTips":["Convert all brand assets to PNG/ICNS during the asset pipeline, not at app launch","Add a lint rule on the desktop config restricting icon extensions"],"tags":["desktop","icons","macos","file-format","validation"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}