paperclipai/paperclip · error · Error
networkAllowlist[ ] must be a string.
Error message
networkAllowlist[${index}] must be a string. What it means
parseLocalProcessNetworkAllowlist received a networkAllowlist array containing a non-string entry at the given index; entries must be strings.
Solutions
- Make networkAllowlist[${index}] a string value.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/adapter-utils/src/local-process-sandbox.ts:145 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/7d4c08948b576abb.
Report an issue: GitHub.
Appendix: source
Thrown at packages/adapter-utils/src/local-process-sandbox.ts:145
const parsed = new URL(trimmed.includes("://") ? trimmed : `https://${trimmed}`);
if (parsed.username || parsed.password || parsed.pathname !== "/" || parsed.search || parsed.hash) {
throw new Error("path");
}
hostname = parsed.hostname.toLowerCase();
port = parsed.port || null;
} catch {
throw new Error(`networkAllowlist[${index}] must be a hostname, hostname:port, or origin URL.`);
}
if (!hostname || hostname === "*" || hostname.startsWith("*.")) {
throw new Error(`networkAllowlist[${index}] must use an exact hostname; wildcards are not supported.`);
}
return { hostname, port };
}
export function parseLocalProcessNetworkAllowlist(value: unknown): string[] {
if (!Array.isArray(value)) return [];
return value.map((entry, index) => {
if (typeof entry !== "string") throw new Error(`networkAllowlist[${index}] must be a string.`);
const rule = parseNetworkAllowlistEntry(entry, index);
return rule.port ? `${rule.hostname}:${rule.port}` : rule.hostname;
});
}
export function parseLocalProcessNetworkScope(value: unknown): LocalProcessNetworkScope | null {
if (value == null || value === "") return null;
if (value === "deny" || value === "allowlist") return value;
throw new Error('networkScope must be "deny" or "allowlist".');
}
export function parseLocalProcessFilesystemScope(value: unknown): "workspace" | null {
if (value == null || value === "") return null;
if (value === "workspace") return value;
throw new Error('filesystemScope must be "workspace".');
}
function isNetworkTargetAllowed(hostname: string, port: string, rules: NetworkAllowlistRule[]): boolean {View on GitHub (pinned to 120ae5428f)