musistudio/claude-code-router · error

Plugin app URL must be an http(s) URL or a CCR gateway path.

Error message

Plugin app URL must be an http(s) URL or a CCR gateway path.

What it means

Error "Plugin app URL must be an http(s) URL or a CCR gateway path." thrown in musistudio/claude-code-router.

Source

Thrown at packages/electron/src/main/deep-link.ts:401

  const urlPath = trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
  const host = normalizeGatewayPluginAppHost(config.gateway?.host || config.HOST || "127.0.0.1");
  const port = config.gateway?.port || config.PORT || 3456;
  return `http://${host}:${port}${urlPath}`;
}

function normalizePluginAppUrl(value: string): string {
  const trimmed = value.trim();
  if (!trimmed) {
    throw new Error("Plugin app URL is required.");
  }
  if (/^https?:\/\//i.test(trimmed)) {
    return new URL(trimmed).toString();
  }
  if (trimmed.startsWith("//")) {
    throw new Error("Plugin app URL cannot be protocol-relative.");
  }
  if (/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(trimmed)) {
    throw new Error("Plugin app URL must be an http(s) URL or a CCR gateway path.");
  }
  return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
}

function normalizeGatewayPluginAppHost(host: string): string {
  const trimmed = host.trim();
  if (!trimmed || trimmed === "0.0.0.0" || trimmed === "::") {
    return "127.0.0.1";
  }
  if (trimmed.includes(":") && !trimmed.startsWith("[")) {
    return `[${trimmed}]`;
  }
  return trimmed;
}

function createProviderDeepLinkRequest(rawUrl: string): ProviderDeepLinkRequest {
  const request = createSharedProviderDeepLinkRequest(rawUrl);
  if (!request.provider) {

View on GitHub (pinned to 99f24806c6)

When it happens

Trigger: Thrown at packages/electron/src/main/deep-link.ts:401 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/c387751d5624bedf. Report an issue: GitHub.