{"record":{"id":"ffbabc51b36e0d97","repo":"remotion-dev/remotion","slug":"remotion-lambda-can-only-render-based-on-a-url-in-ffbabc","errorCode":null,"errorMessage":"Remotion Lambda can only render based on a URL in the cloud. It seems like you passed a local file: ${urlOrId}. Read the setup guide for Remotion Lambda ${DOCS_URL}/docs/lambda/setup","messagePattern":"Remotion Lambda can only render based on a URL in the cloud\\. It seems like you passed a local file: (.+?)\\. Read the setup guide for Remotion Lambda (.+?)/docs/lambda/setup","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda-client/src/convert-to-serve-url.ts","lineNumber":14,"sourceCode":"import {DOCS_URL} from '@remotion/serverless-client';\nimport type {AwsRegion} from './regions';\n\nexport const convertToServeUrlImplementation = ({\n\turlOrId,\n\tregion,\n\tbucketName,\n}: {\n\turlOrId: string;\n\tregion: AwsRegion;\n\tbucketName: string;\n}) => {\n\tif (urlOrId.startsWith('src/')) {\n\t\tthrow new Error(\n\t\t\t`Remotion Lambda can only render based on a URL in the cloud. It seems like you passed a local file: ${urlOrId}. Read the setup guide for Remotion Lambda ${DOCS_URL}/docs/lambda/setup`,\n\t\t);\n\t}\n\n\tif (urlOrId.startsWith('http://') || urlOrId.startsWith('https://')) {\n\t\treturn urlOrId;\n\t}\n\n\treturn `https://${bucketName}.s3.${region}.amazonaws.com/sites/${urlOrId}/index.html`;\n};\n","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-client/src/convert-to-serve-url.ts#L1-L25","documentation":"convertToServeUrl throws if the serve-url argument starts with 'src/'. Remotion Lambda renders only from a deployed cloud site (an HTTPS URL or a site id), never from local source files. This guard catches the common mistake of passing a local entry point.","triggerScenarios":"Passing 'src/index.ts', 'src/index.tsx', or any 'src/'-prefixed local path to renderMediaOnLambda's serveUrl (or any API that calls convertToServeUrl).","commonSituations":"Confusing Remotion Lambda (cloud render) with local renderMedia; forgetting to deploy a site first; copy-pasting a local path.","solutions":["Deploy your composition to a Lambda site with deploySite() and pass the returned serveUrl (or the site id)","Or pass a public HTTPS URL of your bundled Remotion project","Never pass a local src/ path to a Lambda render API"],"exampleFix":"// before\nawait renderMediaOnLambda({ serveUrl: 'src/index.ts', composition: 'MyVideo', ... });\n\n// after\nconst {serveUrl} = await deploySite({ entryPoint: 'src/index.ts', ... });\nawait renderMediaOnLambda({ serveUrl, composition: 'MyVideo', ... });","handlingStrategy":"validation","validationCode":"function assertServeUrl(url: string) {\n  if (url.startsWith('src/')) {\n    throw new Error('Pass a deployed site URL or site id, not a local src/ path');\n  }\n}","typeGuard":"const isServeUrl = (v: string): boolean => v.startsWith('http://') || v.startsWith('https://') || !v.startsWith('src/');","tryCatchPattern":null,"preventionTips":["Always deploy a site first (deploySite) and pass the returned serveUrl","Centralize serve-URL construction so local paths never reach render APIs","Reject 'src/' values in your own input layer"],"tags":["lambda","serve-url","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}