remotion-dev/remotion · error · TypeError
"serviceName" parameter must be a string, but is ${JSON.stri
Error message
"serviceName" parameter must be a string, but is ${JSON.stringify(serviceName)} What it means
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.
Source
Thrown at packages/cloudrun/src/shared/validate-service-name.ts:3
export const validateServiceName = (serviceName: unknown) => {
if (typeof serviceName !== 'string') {
throw new TypeError(
`"serviceName" parameter must be a string, but is ${JSON.stringify(
serviceName,
)}`,
);
}
};
View on GitHub (pinned to 78fe4bb3fd)
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.
Example fix
// before
renderMediaOnCloudRun({ serviceName: deployment, ... });
// after
renderMediaOnCloudRun({ serviceName: deployment.name, ... }); Defensive patterns
Strategy: type-guard
Validate before calling
if (typeof serviceName !== 'string' || serviceName.length === 0) {
throw new TypeError('serviceName must be a non-empty string');
} Type guard
const isServiceName = (v: unknown): v is string => typeof v === 'string' && v.length > 0;
Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- maxRetries must be a number, but is ${JSON.stringify(maxRetr
- "serveURL" parameter must be a string, but is ${JSON.stringi
- The 'siteName' argument must be a string if provided, but is
- Bucket creation is required, but no region has been passed.
- 'bucketName' must be a string, but is ${JSON.stringify(bucke
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/3a8a100bc9b77f22.
Report an issue: GitHub.