musistudio/claude-code-router · error

Plugin app URL cannot be protocol-relative.

Error message

Plugin app URL cannot be protocol-relative.

What it means

Error "Plugin app URL cannot be protocol-relative." thrown in musistudio/claude-code-router.

Source

Thrown at packages/core/src/plugins/service.ts:1092

    ...(app.description?.trim() ? { description: app.description.trim() } : {}),
    ...(app.icon?.trim() ? { icon: app.icon.trim() } : {}),
    id: app.id?.trim() || sanitizeFileSegment(`${name}-${url}`) || `app-${index}`,
    name,
    pluginId,
    url
  };
}

function normalizePluginAppUrl(value: string | undefined): string {
  const trimmed = value?.trim() || "";
  if (!trimmed) {
    return "";
  }
  if (/^https?:\/\//i.test(trimmed)) {
    return new URL(trimmed).toString();
  }
  if (trimmed.startsWith("//")) {
    throw new Error("Plugin app URL cannot be protocol-relative.");
  }
  if (isProtocolSpecifier(trimmed)) {
    throw new Error("Plugin app URL must be an http(s) URL or a CCR gateway path.");
  }
  return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
}

function normalizeMethods(route: GatewayPluginRouteRegistration): string[] | undefined {
  const methods = [...(route.methods ?? []), ...(route.method ? [route.method] : [])]
    .map((method) => method.trim().toUpperCase())
    .filter(Boolean);
  return methods.length ? [...new Set(methods)] : undefined;
}

function normalizeRoutePath(value: string | undefined): string | undefined {
  if (typeof value !== "string" || !value.trim()) {
    return undefined;
  }

View on GitHub (pinned to 99f24806c6)

When it happens

Trigger: Thrown at packages/core/src/plugins/service.ts:1092 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of musistudio/claude-code-router@99f24806c6 (2026-08-27). Data as JSON: /api/errors/3e55972fa22752ae. Report an issue: GitHub.