{"record":{"id":"a6536bd5c09704ed","repo":"remotion-dev/remotion","slug":"the-project-id-must-match-the-regexp-a-za-z","errorCode":null,"errorMessage":"The `project-id` must match the RegExp `/^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/g`. This means it may only start with a letter, end with a letter or number, and contain up to 49 lowercase letters, numbers or hyphens. You passed: ${projectID}. Check for invalid characters.","messagePattern":"The `project-id` must match the RegExp `/\\^\\[a-zA-Z\\]\\[a-zA-Z0-9-\\](.+?)\\[a-zA-Z0-9\\]\\$/g`\\. This means it may only start with a letter, end with a letter or number, and contain up to 49 lowercase letters, numbers or hyphens\\. You passed: (.+?)\\. Check for invalid characters\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/shared/validate-project-id.ts","lineNumber":17,"sourceCode":"export const validateProjectID = (projectID: unknown) => {\n\tif (typeof projectID === 'undefined') {\n\t\tthrow new TypeError(\n\t\t\t`The 'project-id' argument must be provided, but is missing.`,\n\t\t);\n\t}\n\n\tif (typeof projectID !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`The 'project-id' argument must be a string, but is ${JSON.stringify(\n\t\t\t\tprojectID,\n\t\t\t)}`,\n\t\t);\n\t}\n\n\tif (!projectID.match(/^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/g)) {\n\t\tthrow new Error(\n\t\t\t'The `project-id` must match the RegExp `/^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/g`. This means it may only start with a letter, end with a letter or number, and contain up to 49 lowercase letters, numbers or hyphens. You passed: ' +\n\t\t\t\tprojectID +\n\t\t\t\t'. Check for invalid characters.',\n\t\t);\n\t}\n};\n","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/shared/validate-project-id.ts#L1-L24","documentation":"Thrown by validateProjectID() when projectID fails the GCP project-id naming regex: must start with a letter, end with a letter or number, contain only lowercase letters, digits, and hyphens, with total length 6-50 (one leading letter + up to 48 middle + one trailing). Enforces Google's project id rules before the API call to avoid opaque GCP errors.","triggerScenarios":"Passing a project id with uppercase letters, an underscore, a leading digit, a trailing hyphen, or out-of-range length. The message echoes the regex and the offending value.","commonSituations":"Typo; mixing project name (which permits uppercase) with project id (which does not); trailing whitespace; copy-paste with forbidden characters.","solutions":["Use the exact project id from the GCP console (lowercase, hyphens, letters/digits).","Strip accidental whitespace and lowercase the value before passing.","If the value contains underscores, switch to the canonical hyphenated project id."],"exampleFix":"// before\nawait deployService({ projectID: 'My_Project', ... });\n// after\nawait deployService({ projectID: 'my-project', ... });","handlingStrategy":"validation","validationCode":"const PROJECT_ID_RE = /^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/;\nif (!PROJECT_ID_RE.test(projectID)) {\n  throw new Error(`Invalid GCP project id: ${projectID}`);\n}\nvalidateProjectID(projectID);","typeGuard":"function isValidGcpProjectId(v: string): boolean {\n  return /^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/.test(v);\n}","tryCatchPattern":"// Validate before the API call; do not retry — value is deterministic.","preventionTips":["Copy the project id verbatim from the GCP console.","Avoid uppercase and underscores; use lowercase and hyphens only.","Trim whitespace before validating."],"tags":["cloudrun","validation","project-id","regex","gcp"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}