{"record":{"id":"bd74b5768e10a928","repo":"remotion-dev/remotion","slug":"the-sitename-must-match-the-regexp-valid-sit","errorCode":null,"errorMessage":"The `siteName` must match the RegExp `/${VALID_SITE_NAME_RE.source}/`. You passed: ${siteName}. Check for invalid characters.","messagePattern":"The `siteName` must match the RegExp `/(.+?)/`\\. You passed: (.+?)\\. Check for invalid characters\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-site-name.ts","lineNumber":23,"sourceCode":"\t\treturn;\n\t}\n\n\tif (typeof siteName !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`The 'siteName' argument must be a string if provided, but is ${JSON.stringify(\n\t\t\t\tsiteName,\n\t\t\t)}`,\n\t\t);\n\t}\n\n\tif (siteName === '.' || siteName === '..') {\n\t\tthrow new Error(\n\t\t\t'The `siteName` must not be `.` or `..`. You passed: ' + siteName + '.',\n\t\t);\n\t}\n\n\tif (!VALID_SITE_NAME_RE.test(siteName)) {\n\t\tthrow new Error(\n\t\t\t'The `siteName` must match the RegExp `/' +\n\t\t\t\tVALID_SITE_NAME_RE.source +\n\t\t\t\t'/`. You passed: ' +\n\t\t\t\tsiteName +\n\t\t\t\t'. Check for invalid characters.',\n\t\t);\n\t}\n};\n","sourceCodeStart":5,"sourceCodeEnd":32,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-site-name.ts#L5-L32","documentation":"Thrown by validateSiteName() in @remotion/lambda when siteName is a string but contains characters outside the allowed set. The allowed RegExp is /^[-0-9a-zA-Z!_.*'()]+$/ (letters, digits, '-', '_', '.', '*', \"'\", '(', ')', '!'). siteName feeds into S3 bucket/key naming where AWS forbids many characters.","triggerScenarios":"Passing a siteName containing spaces, slashes, '@', '#', '&', '+', commas, colons, Unicode, or any character not in the allowed class. Also thrown for the empty string '' (the regex requires at least one character via +).","commonSituations":"Using a project name with spaces ('My Project'), an email ('team@corp.com'), a URL-style slug with '/', or a localized/Unicode name. Empty string from an untrimmed empty input.","solutions":["Restrict siteName to alphanumerics and hyphens/underscores (the safest subset), e.g. 'my-project'.","Slugify free-form input before passing: name.toLowerCase().replace(/[^a-z0-9-]+/g, '-').","Ensure the string is non-empty; pass undefined for the default."],"exampleFix":"// before\nawait deploySite({ siteName: 'My Project v2!' }); // spaces are invalid\n\n// after\nconst siteName = 'My Project v2!'.toLowerCase().replace(/[^a-z0-9-_.]+/g, '-');\nawait deploySite({ siteName });","handlingStrategy":"validation","validationCode":"const SITE_NAME_RE = /^[-0-9a-zA-Z!_.*'()]+$/;\nfunction toSiteName(raw: string): string | undefined {\n  const slug = raw.toLowerCase().replace(/[^a-z0-9-_.]+/g, '-').replace(/^-+|-+$/g, '');\n  return SITE_NAME_RE.test(slug) ? slug : undefined;\n}","typeGuard":"const isValidSiteName = (v: unknown): v is string =>\n  typeof v === 'string' && /^[-0-9a-zA-Z!_.*'()]+$/.test(v);","tryCatchPattern":null,"preventionTips":["Restrict site names to the safe subset (alphanumeric, '-', '_').","Run a slugify step on any free-form input.","Reject the empty string explicitly (it fails the + quantifier)."],"tags":["lambda","validation","site-name","s3","regex","configuration"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}