remotion-dev/remotion · error · TypeError
"serveURL" parameter must be a string, but is ${JSON.stringi
Error message
"serveURL" parameter must be a string, but is ${JSON.stringify(serveUrl)} What it means
Thrown by validateServeUrl() in @remotion/lambda-client when the serveUrl argument passed to renderMediaOnLambda() / getCompositionsOnLambda() / deploySite() is not a string. serveUrl identifies the deployed Remotion Serve (either a URL or an S3 subfolder name), and the rest of the pipeline assumes a string.
Source
Thrown at packages/lambda-client/src/validate-serveurl.ts:3
export const validateServeUrl = (serveUrl: unknown) => {
if (typeof serveUrl !== 'string') {
throw new TypeError(
`"serveURL" parameter must be a string, but is ${JSON.stringify(
serveUrl,
)}`,
);
}
};
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- If you hold a URL object, pass serveUrl.toString() (or href).
- Ensure the variable you pass is actually a string by checking typeof before the call.
- If the value comes from a config, serialize/cast it to a string at the boundary.
Example fix
// before
const serveUrl = new URL('https://remotionlambda-abc.s3.amazonaws.com/sites/test');
await renderMediaOnLambda({serveUrl, ...});
// after
const serveUrl = new URL('https://remotionlambda-abc.s3.amazonaws.com/sites/test').toString();
await renderMediaOnLambda({serveUrl, ...}); Defensive patterns
Strategy: type-guard
Validate before calling
const serveUrl = typeof input === 'object' && input !== null && 'href' in input ? String(input.href) : String(input);
await renderMediaOnLambda({serveUrl, ...}); Type guard
const isServeUrl = (v: unknown): v is string => typeof v === 'string';
Prevention
- Call .toString() on URL objects before passing them as serveUrl.
- Type your config loader to return string for the serveUrl field.
- Add a typeof check in dev builds to catch accidental object inputs.
When it happens
Trigger: Passing serveUrl as a URL object (new URL(...)), a number, undefined, null, or an object. The check is purely on typeof === 'string'.
Common situations: Constructing a URL with the browser/Node URL class and forgetting to .toString(); reading serveUrl from a config that returned an object; passing the result of an async call that resolved to an object instead of a string.
Related errors
- maxRetries must be a number, but is ${JSON.stringify(maxRetr
- maxRetries must be finite, but is ${maxRetries}
- Remotion Lambda can only render based on a URL in the cloud.
- parameter 'memorySizeInMb' must not be NaN, but is
- parameter 'memorySizeInMb' must be finite, but is ${memorySi
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/9b61a81a63d7d13c.
Report an issue: GitHub.