{"record":{"id":"b66ca52b0b27b81d","repo":"remotion-dev/remotion","slug":"region-parameter-must-be-one-of-gcp-regions-jo","errorCode":null,"errorMessage":"\"region\" parameter must be one of ${GCP_REGIONS.join(', ')}, but is ${JSON.stringify(region)}","messagePattern":"\"region\" parameter must be one of (.+?), but is (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/shared/validate-region.ts","lineNumber":13,"sourceCode":"import type {GcpRegion} from '../pricing/gcp-regions';\nimport {GCP_REGIONS} from '../pricing/gcp-regions';\n\nexport const validateRegion = (region: unknown) => {\n\tif (typeof region !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`\"region\" parameter must be a string, but is ${JSON.stringify(region)}`,\n\t\t);\n\t}\n\n\t// check region is part of GCP_REGIONS list\n\tif (!GCP_REGIONS.includes(region as GcpRegion)) {\n\t\tthrow new TypeError(\n\t\t\t`\"region\" parameter must be one of ${GCP_REGIONS.join(\n\t\t\t\t', ',\n\t\t\t)}, but is ${JSON.stringify(region)}`,\n\t\t);\n\t}\n\n\treturn region as GcpRegion;\n};\n","sourceCodeStart":1,"sourceCodeEnd":22,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/shared/validate-region.ts#L1-L22","documentation":"Thrown by validateRegion() when region is a string but not in GCP_REGIONS. The message lists all valid regions and echoes the offending value. This is the value/membership check that runs after the string-type guard.","triggerScenarios":"Passing a region string not in GCP_REGIONS — e.g., an AWS region name ('us-east-1'), a typo ('us-east11'), or a GCP region Remotion does not yet list.","commonSituations":"Confusing AWS and GCP region naming; using a newly announced GCP region not yet in the installed @remotion/cloudrun version; copy-pasting from Lambda examples; typo.","solutions":["Use a region from the printed list, e.g. 'us-east1', 'us-central1', 'europe-west1'.","Upgrade @remotion/cloudrun if your region was added after your installed version.","Confirm the region string in the GCP console and copy it exactly."],"exampleFix":"// before\nawait deployService({ region: 'us-east-1', ... }); // AWS-style name\n// after\nawait deployService({ region: 'us-east1', ... }); // GCP-style name","handlingStrategy":"validation","validationCode":"import { GCP_REGIONS } from '@remotion/cloudrun/pricing/gcp-regions';\nif (!(GCP_REGIONS as readonly string[]).includes(region)) {\n  throw new Error(`Invalid GCP region: ${region}. Valid: ${GCP_REGIONS.join(', ')}`);\n}","typeGuard":"import { GCP_REGIONS } from '@remotion/cloudrun/pricing/gcp-regions';\nfunction isValidGcpRegion(v: unknown): boolean {\n  return typeof v === 'string' && (GCP_REGIONS as readonly string[]).includes(v);\n}","tryCatchPattern":"// Validate once at config load; do not retry on invalid region.","preventionTips":["Use GCP region names (us-east1), never AWS ones (us-east-1).","Upgrade @remotion/cloudrun to pick up newly added regions.","Cross-check the region string in the GCP console."],"tags":["cloudrun","validation","region","gcp"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}