{"record":{"id":"980d7a1463b19e8a","repo":"remotion-dev/remotion","slug":"the-project-id-argument-must-be-provided-but-is","errorCode":null,"errorMessage":"The 'project-id' argument must be provided, but is missing.","messagePattern":"The 'project-id' argument must be provided, but is missing\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/shared/validate-project-id.ts","lineNumber":3,"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);","sourceCodeStart":1,"sourceCodeEnd":21,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/shared/validate-project-id.ts#L1-L21","documentation":"Thrown by validateProjectID() when projectID is undefined (the first check, before the string-type check). The GCP project id is required for any Cloud Run API call that authenticates and addresses resources. Failing here means the caller did not supply a project id at all.","triggerScenarios":"Calling an API with projectID omitted entirely (undefined), typically because the value was not read from env/config or was destructured away.","commonSituations":"The GOOGLE_CLOUD_PROJECT or GCLOUD_PROJECT env var is unset; passing an options object that omitted projectId; a config loader returned undefined.","solutions":["Set the project id explicitly from env: projectID: process.env.GOOGLE_CLOUD_PROJECT.","Run `gcloud config set project <your-project>` and ensure your application reads it.","Add a startup assertion that the project id env var is present."],"exampleFix":"// before\nawait deployService({ projectID: process.env.GCLOUD_PROJECT, ... }); // undefined\n// after\nconst projectID = process.env.GOOGLE_CLOUD_PROJECT;\nif (!projectID) throw new Error('GOOGLE_CLOUD_PROJECT env var must be set');\nawait deployService({ projectID, ... });","handlingStrategy":"type-guard","validationCode":"import { validateProjectID } from '@remotion/cloudrun/shared';\nvalidateProjectID(projectID);","typeGuard":"function isProjectIDDefined(v: unknown): v is string {\n  return typeof v !== 'undefined';\n}","tryCatchPattern":"const projectID = process.env.GOOGLE_CLOUD_PROJECT;\nif (typeof projectID === 'undefined') throw new Error('Set GOOGLE_CLOUD_PROJECT');","preventionTips":["Always source project id from a known env var and assert it at startup.","Run `gcloud config set project <id>` in your shell or CI.","Add a config schema check before any Cloud Run call."],"tags":["cloudrun","validation","gcp","project-id"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}