{"record":{"id":"54f0c85309fa6a8c","repo":"musistudio/claude-code-router","slug":"plugin-app-url-cannot-be-protocol-relative-54f0c8","errorCode":null,"errorMessage":"Plugin app URL cannot be protocol-relative.","messagePattern":"Plugin app URL cannot be protocol-relative\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/electron/src/main/deep-link.ts","lineNumber":398,"sourceCode":"  if (/^https?:\\/\\//i.test(trimmed)) {\n    return trimmed;\n  }\n  const urlPath = trimmed.startsWith(\"/\") ? trimmed : `/${trimmed}`;\n  const host = normalizeGatewayPluginAppHost(config.gateway?.host || config.HOST || \"127.0.0.1\");\n  const port = config.gateway?.port || config.PORT || 3456;\n  return `http://${host}:${port}${urlPath}`;\n}\n\nfunction normalizePluginAppUrl(value: string): string {\n  const trimmed = value.trim();\n  if (!trimmed) {\n    throw new Error(\"Plugin app URL is required.\");\n  }\n  if (/^https?:\\/\\//i.test(trimmed)) {\n    return new URL(trimmed).toString();\n  }\n  if (trimmed.startsWith(\"//\")) {\n    throw new Error(\"Plugin app URL cannot be protocol-relative.\");\n  }\n  if (/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(trimmed)) {\n    throw new Error(\"Plugin app URL must be an http(s) URL or a CCR gateway path.\");\n  }\n  return trimmed.startsWith(\"/\") ? trimmed : `/${trimmed}`;\n}\n\nfunction normalizeGatewayPluginAppHost(host: string): string {\n  const trimmed = host.trim();\n  if (!trimmed || trimmed === \"0.0.0.0\" || trimmed === \"::\") {\n    return \"127.0.0.1\";\n  }\n  if (trimmed.includes(\":\") && !trimmed.startsWith(\"[\")) {\n    return `[${trimmed}]`;\n  }\n  return trimmed;\n}\n","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/electron/src/main/deep-link.ts#L380-L416","documentation":"Error \"Plugin app URL cannot be protocol-relative.\" thrown in musistudio/claude-code-router.","triggerScenarios":"Thrown at packages/electron/src/main/deep-link.ts:398 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":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}