{"record":{"id":"9b61a81a63d7d13c","repo":"remotion-dev/remotion","slug":"serveurl-parameter-must-be-a-string-but-is-js-9b61a8","errorCode":null,"errorMessage":"\"serveURL\" parameter must be a string, but is ${JSON.stringify(serveUrl)}","messagePattern":"\"serveURL\" parameter must be a string, but is (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/lambda-client/src/validate-serveurl.ts","lineNumber":3,"sourceCode":"export const validateServeUrl = (serveUrl: unknown) => {\n\tif (typeof serveUrl !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`\"serveURL\" parameter must be a string, but is ${JSON.stringify(\n\t\t\t\tserveUrl,\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/lambda-client/src/validate-serveurl.ts#L1-L10","documentation":"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.","triggerScenarios":"Passing serveUrl as a URL object (new URL(...)), a number, undefined, null, or an object. The check is purely on typeof === 'string'.","commonSituations":"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.","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."],"exampleFix":"// before\nconst serveUrl = new URL('https://remotionlambda-abc.s3.amazonaws.com/sites/test');\nawait renderMediaOnLambda({serveUrl, ...});\n\n// after\nconst serveUrl = new URL('https://remotionlambda-abc.s3.amazonaws.com/sites/test').toString();\nawait renderMediaOnLambda({serveUrl, ...});","handlingStrategy":"type-guard","validationCode":"const serveUrl = typeof input === 'object' && input !== null && 'href' in input ? String(input.href) : String(input);\nawait renderMediaOnLambda({serveUrl, ...});","typeGuard":"const isServeUrl = (v: unknown): v is string => typeof v === 'string';","tryCatchPattern":null,"preventionTips":["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."],"tags":["lambda","validation","typescript","serve-url"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}