{"record":{"id":"e47d0158ca80e4ed","repo":"denoland/deno","slug":"unexpected-name-field-in-options-bench-name-is","errorCode":null,"errorMessage":"Unexpected 'name' field in options, bench name is already provided as the first argument","messagePattern":"Unexpected 'name' field in options, bench name is already provided as the first argument","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"cli/js/40_bench.js","lineNumber":130,"sourceCode":"  };\n\n  if (typeof nameOrFnOrOptions === \"string\") {\n    if (!nameOrFnOrOptions) {\n      throw new TypeError(\"The bench name can't be empty\");\n    }\n    if (typeof optionsOrFn === \"function\") {\n      benchDesc = { fn: optionsOrFn, name: nameOrFnOrOptions, ...defaults };\n    } else {\n      if (!maybeFn || typeof maybeFn !== \"function\") {\n        throw new TypeError(\"Missing bench function\");\n      }\n      if (optionsOrFn.fn != undefined) {\n        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) {","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/js/40_bench.js#L112-L148","documentation":"`deno desktop` validates configured deep-link URL schemes against the RFC 3986 scheme grammar — it must start with an ASCII letter and contain only letters, digits, `+`, `-`, `.` — and additionally rejects the reserved schemes http, https, file, ftp, ws, and wss, since registering those as app handlers would hijack normal browsing.","triggerScenarios":"A deep-link scheme entry that is empty, starts with a digit or symbol, contains characters outside ALPHA/DIGIT/`+`/`-`/`.` (space, underscore, colon), or equals one of the reserved schemes.","commonSituations":"Pasting a full URL (`https://myapp.example`) into a scheme field; using snake_case scheme names; leaving the scheme field empty in generated config; attempting to claim `http`/`ws` for an app.","solutions":["Use a bare custom scheme starting with a letter, e.g. `myapp` or `com.example.myapp`","Strip `://` and any host/path — pass only the scheme token","Replace invalid characters: underscores become hyphens, no spaces or colons allowed","If you wanted a web-style link, keep using a custom scheme plus your site's handle; do not register reserved schemes"],"exampleFix":"// before (desktop config)\n\"deepLinks\": [\"https://myapp.example/open\"]\n\n// after\n\"deepLinks\": [\"myapp\"]","handlingStrategy":"validation","validationCode":null,"typeGuard":"const RESERVED = new Set(['http', 'https', 'file', 'ftp', 'ws', 'wss']);\nfunction isValidScheme(s: string): boolean {\n  return /^[A-Za-z][A-Za-z0-9+.-]*$/.test(s) && !RESERVED.has(s.toLowerCase());\n}","tryCatchPattern":null,"preventionTips":["Store only the bare scheme token in config — never a full URL","Lint desktop config for reserved schemes and non-RFC3986 characters before build","Prefer reverse-DNS schemes (com.example.myapp) for uniqueness"],"tags":["desktop","deep-links","validation","config","rfc3986"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}