{"record":{"id":"6a88fa802e9efbbf","repo":"denoland/deno","slug":"icon-must-be-icns-or-png","errorCode":null,"errorMessage":"icon '{}' must be .icns or .png","messagePattern":"icon '(.+?)' must be \\.icns or \\.png","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/desktop.rs","lineNumber":1169,"sourceCode":"/// laufey passes to `-[NSImage initWithContentsOfFile:]` (both formats are\n/// accepted, so no conversion is needed).\n#[cfg(target_os = \"macos\")]\nfn resolve_hmr_icon_path(\n  icon: &crate::args::IconConfig,\n  initial_cwd: &Path,\n) -> Result<PathBuf, AnyError> {\n  let icon_path = match icon {\n    crate::args::IconConfig::Single(p) => initial_cwd.join(p),\n    crate::args::IconConfig::Set(_) => {\n      deno_core::anyhow::bail!(\"icon sets are not supported in --hmr mode yet\")\n    }\n  };\n  if !icon_path.exists() {\n    deno_core::anyhow::bail!(\"icon '{}' not found\", icon_path.display());\n  }\n  match icon_path.extension().and_then(|e| e.to_str()) {\n    Some(\"icns\") | Some(\"png\") => {}\n    _ => deno_core::anyhow::bail!(\n      \"icon '{}' must be .icns or .png\",\n      icon_path.display()\n    ),\n  }\n  Ok(crate::util::fs::canonicalize_path(&icon_path).unwrap_or(icon_path))\n}\n\n/// Extract the local URL from a line of dev server output.\nfn parse_dev_server_url(line: &str) -> Option<String> {\n  let line = console_static_text::ansi::strip_ansi_codes(line);\n  // Vite prints `  ➜  Local:   http://localhost:5173/`\n  regex::Regex::new(r\"Local:\\s+(https?://\\S+)\")\n    .expect(\"regex to parse local url failed\")\n    .captures(&line)\n    .and_then(|c| c.get(1))\n    .map(|m| m.as_str().to_owned())\n}\n","sourceCodeStart":1151,"sourceCodeEnd":1187,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/desktop.rs#L1151-L1187","documentation":"Error \"icon '{}' must be .icns or .png\" thrown in denoland/deno.","triggerScenarios":"Thrown at cli/tools/desktop.rs:1169 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}