{"record":{"id":"561e321e985ac998","repo":"paperclipai/paperclip","slug":"row-slug-invalid-aliases","errorCode":null,"errorMessage":"${row.slug}: invalid aliases","messagePattern":"(.+?): invalid aliases","errorType":"console","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/app-brand-validation.mjs","lineNumber":35,"sourceCode":"    throw new Error(`${filename}: SVG requires a viewBox or intrinsic width and height`);\n  }\n  if (/<!DOCTYPE|<!ENTITY|<\\?xml-stylesheet|&#|<\\s*(?:[\\w-]+:)?(?:script|foreignObject|image|feImage|iframe|object|embed|animate\\w*|set|a)\\b|\\bon[\\w-]+\\s*=/i.test(svg)\n    || /\\b(?:[\\w-]+:)?href\\s*=\\s*[\"'](?!#)/i.test(svg)\n    || /@import|@media|url\\(\\s*[\"']?(?!#)[^)]*\\)|(?:javascript|data|https?):|\\\\/i.test(svg.replace(/xmlns(?::[\\w-]+)?\\s*=\\s*[\"'][^\"']*[\"']/gi, \"\"))) {\n    throw new Error(`${filename}: unsafe SVG feature, external resource, theme media query, or embedded raster wrapper`);\n  }\n}\n\nexport function validateManifest(manifest, readAsset) {\n  if (manifest.schemaVersion !== 1 || !Array.isArray(manifest.providers)) throw new Error(\"Invalid brand manifest\");\n  const keys = new Map();\n  const slugs = new Set();\n  for (const row of manifest.providers) {\n    if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(row.slug) || slugs.has(row.slug)) throw new Error(`Duplicate or invalid slug: ${row.slug}`);\n    slugs.add(row.slug);\n    if (typeof row.provider !== \"string\" || !row.provider.trim()) throw new Error(`${row.slug}: missing provider name`);\n    const aliases = row.aliases ?? [];\n    if (!Array.isArray(aliases) || aliases.some((alias) => typeof alias !== \"string\" || !alias.trim())) throw new Error(`${row.slug}: invalid aliases`);\n    for (const name of [row.slug, row.provider, ...aliases]) {\n      const key = normalizeBrandKey(name);\n      if (keys.has(key) && keys.get(key) !== row.slug) throw new Error(`${row.slug}: ambiguous brand alias ${name}`);\n      keys.set(key, row.slug);\n    }\n    for (const asset of new Set([row.localAsset, ...(row.darkAsset === undefined ? [] : [row.darkAsset])])) {\n      if (typeof asset !== \"string\" || !assetPathPattern.test(asset)) throw new Error(`${row.slug}: invalid asset path`);\n      validateArtwork(readAsset(asset), asset);\n    }\n  }\n  return manifest.providers.length;\n}\n","sourceCodeStart":17,"sourceCodeEnd":48,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/scripts/app-brand-validation.mjs#L17-L48","documentation":"The app brand validation script throws this when a provider row's aliases are invalid: the aliases field is present but not an array, or it contains entries that are not strings or are empty/whitespace strings.","triggerScenarios":"Running validateManifest where row.aliases is a string instead of an array, an alias element is null/number/object, or an alias is \"\" or \" \".","commonSituations":"Writing aliases: \"Name\" (singular string) instead of an array; a YAML/JSON edit introducing a null alias; trailing commas or template placeholders left unfilled.","solutions":["Make aliases an array of non-empty strings for the row named by the slug.","Remove or fill in empty/whitespace alias entries.","Ensure the field is spelled `aliases` and is a JSON array, not a single string.","Re-run the validation script after editing."],"exampleFix":"// before\n\"aliases\": \"Acme\"\n// after\n\"aliases\": [\"Acme\", \"Acme Corp\"]","handlingStrategy":"validation","validationCode":"const bad = manifest.providers.filter(r => !Array.isArray(r.aliases ?? []) || (r.aliases ?? []).some(a => typeof a !== 'string' || !a.trim()));\nif (bad.length) throw new Error(`Invalid aliases for: ${bad.map(r => r.slug)}`);","typeGuard":"const hasValidAliases = (row) => (row.aliases ?? []).every(a => typeof a === 'string' && a.trim().length > 0);","tryCatchPattern":"try { validateManifest(manifest); } catch (e) {\n  if (e.message.includes('invalid aliases')) {\n    const slug = e.message.split(':')[0];\n    console.error(`Aliases for ${slug} must be an array of non-empty strings`);\n  } else throw e;\n}","preventionTips":["Always declare aliases as an array, never a bare string.","Lint manifests for null/empty array entries before committing.","Run validation script in pre-commit or CI hooks."],"tags":["manifest","validation","aliases","type-mismatch"],"backgroundTag":"invalid-argument-format","analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}