{"record":{"id":"13b89f25e8bad16e","repo":"remotion-dev/remotion","slug":"the-sitename-argument-must-be-a-string-if-provid-13b89f","errorCode":null,"errorMessage":"The 'siteName' argument must be a string if provided, but is ${JSON.stringify(siteName)}","messagePattern":"The 'siteName' argument must be a string if provided, but is (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-site-name.ts","lineNumber":9,"sourceCode":"const VALID_SITE_NAME_RE = /^[-0-9a-zA-Z!_.*'()]+$/;\n\nexport const validateSiteName = (siteName: unknown) => {\n\tif (typeof siteName === 'undefined') {\n\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 +","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-site-name.ts#L1-L27","documentation":"Thrown by validateSiteName() in @remotion/lambda when the 'siteName' argument is provided (not undefined) but is not a string. siteName is used to namespace Remotion S3 buckets / serve artifacts; AWS bucket naming requires a string. undefined is allowed and means 'use default'.","triggerScenarios":"Calling deploySite(), getOrCreateBucket(), or any API that takes siteName with a non-string value: a number, object, array, or boolean.","commonSituations":"Passing siteName from a loosely-typed config without coercion; spreading an object whose siteName field is null (null is not undefined and will trigger this) or 0.","solutions":["Pass a string siteName, or pass undefined / omit it to use the default.","Coerce before calling: typeof siteName === 'string' ? siteName : undefined.","If null should mean 'default', convert it: siteName: siteName ?? undefined."],"exampleFix":"// before\nawait deploySite({ siteName: config.bucketSuffix }); // config.bucketSuffix is null\n\n// after\nawait deploySite({ siteName: config.bucketSuffix ?? undefined });","handlingStrategy":"type-guard","validationCode":"const siteName = typeof rawSiteName === 'string' && rawSiteName.length > 0 ? rawSiteName : undefined;","typeGuard":"const isOptionalString = (v: unknown): v is string | undefined =>\n  v === undefined || typeof v === 'string';","tryCatchPattern":null,"preventionTips":["Type the field as string | undefined in your config schema.","Normalize null to undefined at the config boundary.","Run validateSiteName(value) in your own preflight to surface the error early."],"tags":["lambda","validation","site-name","s3","configuration"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}