{"record":{"id":"80743e9a9ef8933c","repo":"remotion-dev/remotion","slug":"the-project-id-argument-must-be-a-string-but-is","errorCode":null,"errorMessage":"The 'project-id' argument must be a string, but is ${JSON.stringify(projectID)}","messagePattern":"The 'project-id' argument must be a string, but is (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/shared/validate-project-id.ts","lineNumber":9,"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 is defined but not a string (number, object, array, boolean). Runs after the undefined check, so it specifically catches the case where a value was provided but has the wrong type.","triggerScenarios":"Passing a non-string projectID such as a numeric project number, an object, or an array. Note: GCP distinguishes project id (string) from project number (numeric); only the string id is accepted.","commonSituations":"Passing the numeric project number from the GCP console instead of the string project id; passing a parsed JSON value of the wrong type.","solutions":["Pass the project id string (e.g., 'my-project-123'), not the numeric project number.","Coerce: if you only have the number, look up the project id in the GCP console.","Validate the value's type before calling the API."],"exampleFix":"// before\nawait deployService({ projectID: 1234567890, ... }); // numeric project number\n// after\nawait deployService({ projectID: 'my-project-123', ... }); // string project id","handlingStrategy":"type-guard","validationCode":"import { validateProjectID } from '@remotion/cloudrun/shared';\nvalidateProjectID(projectID);","typeGuard":"function isProjectIDString(v: unknown): v is string {\n  return typeof v === 'string';\n}","tryCatchPattern":"if (typeof projectID !== 'string') throw new TypeError('projectID must be a string id, not a number');","preventionTips":["Pass the project id (string), not the project number.","Copy the id from the GCP console IAM & admin > Settings page.","Type your config so projectID is always a string."],"tags":["cloudrun","validation","typescript","project-id","gcp"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}