paperclipai/paperclip · error · Error

Hostname is required

Error message

Hostname is required

What it means

normalizeHostnameInput got an empty trimmed input (first check), so there is no hostname to allowlist; a required-input guard for hostnames.

Solutions

  1. Provide a non-empty hostname value.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cli/src/config/hostnames.ts:4 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/dc7cf1d05bef1c7f. Report an issue: GitHub.

Appendix: source

Thrown at cli/src/config/hostnames.ts:4

export function normalizeHostnameInput(raw: string): string {
  const input = raw.trim();
  if (!input) {
    throw new Error("Hostname is required");
  }

  try {
    const url = input.includes("://") ? new URL(input) : new URL(`http://${input}`);
    const hostname = url.hostname.trim().toLowerCase();
    if (!hostname) throw new Error("Hostname is required");
    return hostname;
  } catch {
    throw new Error(`Invalid hostname: ${raw}`);
  }
}

export function parseHostnameCsv(raw: string): string[] {
  if (!raw.trim()) return [];
  const unique = new Set<string>();
  for (const part of raw.split(",")) {
    const hostname = normalizeHostnameInput(part);
    unique.add(hostname);

View on GitHub (pinned to 120ae5428f)