{"record":{"id":"50b9b67d748fe51c","repo":"denoland/deno","slug":"unexpected-second-argument-to-deno-bench","errorCode":null,"errorMessage":"Unexpected second argument to Deno.bench()","messagePattern":"Unexpected second argument to Deno\\.bench\\(\\)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"cli/js/40_bench.js","lineNumber":146,"sourceCode":"      }\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) {\n        throw new TypeError(\n          \"Unexpected 'fn' field in options, bench function is already provided as the second argument\",\n        );","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/js/40_bench.js#L128-L164","documentation":"macOS-only. In `--hmr` dev mode the icon is resolved to a single `.png`/`.icns` path passed to laufey via `LAUFEY_APP_ICON`; multi-size icon sets are only supported on the non-HMR build path, so an icon configured as a set aborts HMR startup.","triggerScenarios":"Running `deno desktop --hmr` on macOS with an `icon` configuration that declares a set (multiple sizes) instead of a single path.","commonSituations":"Reusing the production icon-set config unchanged while iterating in HMR dev mode; templates that default to icon sets.","solutions":["Switch the config to a single icon path (one `.png` or `.icns`) for HMR sessions","Or use the regular (non-HMR) build path when the full icon set is required"],"exampleFix":"// before\n\"icon\": { \"set\": \"icons/iconset/\" }\n\n// after\n\"icon\": \"icons/AppIcon.png\"","handlingStrategy":"type-guard","validationCode":"if ('set' in iconConfig) {\n  throw new Error('icon sets unsupported in --hmr — configure a single icon for dev');\n}","typeGuard":"type SingleIcon = { single: string } | string;\nfunction isSingleIcon(icon: unknown): icon is SingleIcon {\n  return typeof icon === 'string' ||\n    (!!icon && typeof icon === 'object' && 'single' in icon && !('set' in icon));\n}","tryCatchPattern":null,"preventionTips":["Maintain a separate dev/HMR desktop config that uses a single icon","Document the limitation wherever icon sets are configured for production builds"],"tags":["desktop","hmr","macos","icons","config","not-yet-supported"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}