{"record":{"id":"3a8a100bc9b77f22","repo":"remotion-dev/remotion","slug":"servicename-parameter-must-be-a-string-but-is","errorCode":null,"errorMessage":"\"serviceName\" parameter must be a string, but is ${JSON.stringify(serviceName)}","messagePattern":"\"serviceName\" parameter must be a string, but is (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/shared/validate-service-name.ts","lineNumber":3,"sourceCode":"export const validateServiceName = (serviceName: unknown) => {\n\tif (typeof serviceName !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`\"serviceName\" parameter must be a string, but is ${JSON.stringify(\n\t\t\t\tserviceName,\n\t\t\t)}`,\n\t\t);\n\t}\n};\n","sourceCodeStart":1,"sourceCodeEnd":10,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/shared/validate-service-name.ts#L1-L10","documentation":"Thrown by validateServiceName() in @remotion/cloudrun when the serviceName argument is not a string. The service name identifies the Google Cloud Run service to invoke, so the validator rejects any non-string before it is used to construct a request.","triggerScenarios":"Calling a Cloud Run API that takes a serviceName with a value that is undefined, null, a number, or an object. Typically happens when the name is read from an unset env var or pulled from a config with a missing key.","commonSituations":"Forgetting to set the service name env var; destructuring a deploy result and passing the wrong field (e.g. the whole object instead of its name); typo in the config key.","solutions":["Ensure the serviceName variable is a non-empty string before the call.","Use the name returned by deployService() rather than hardcoding or deriving it incorrectly.","Check env var / config key names for typos."],"exampleFix":"// before\nrenderMediaOnCloudRun({ serviceName: deployment, ... });\n\n// after\nrenderMediaOnCloudRun({ serviceName: deployment.name, ... });","handlingStrategy":"type-guard","validationCode":"if (typeof serviceName !== 'string' || serviceName.length === 0) {\n  throw new TypeError('serviceName must be a non-empty string');\n}","typeGuard":"const isServiceName = (v: unknown): v is string =>\n  typeof v === 'string' && v.length > 0;","tryCatchPattern":null,"preventionTips":["Pass the .name field returned by deployService().","Always provide the service name env var in your render environment.","Type the option so a non-string is a compile-time error."],"tags":["cloudrun","validation","typescript","configuration"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}