{"record":{"id":"393856170944c62d","repo":"remotion-dev/remotion","slug":"cannot-find-composition-with-id-compnameresult","errorCode":null,"errorMessage":"Cannot find composition with ID \"${compNameResult.compName}\"","messagePattern":"Cannot find composition with ID \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/get-composition-id.ts","lineNumber":137,"sourceCode":"\t\t\t\tonServeUrlVisited: () => undefined,\n\t\t\t\tchromeMode,\n\t\t\t\tmediaCacheSizeInBytes,\n\t\t\t});\n\n\t\tif (propsSize > 10_000_000) {\n\t\t\tLog.warn(\n\t\t\t\t{\n\t\t\t\t\tindent,\n\t\t\t\t\tlogLevel,\n\t\t\t\t},\n\t\t\t\t`The props of your composition are large (${StudioServerInternals.formatBytes(\n\t\t\t\t\tpropsSize,\n\t\t\t\t)}). This may cause slowdown.`,\n\t\t\t);\n\t\t}\n\n\t\tif (!config) {\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot find composition with ID \"${compNameResult.compName}\"`,\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\tcompositionId: compNameResult.compName,\n\t\t\treason: compNameResult.reason,\n\t\t\tconfig,\n\t\t\targsAfterComposition: compNameResult.remainingArgs,\n\t\t};\n\t}\n\n\tconst comps = await RenderInternals.internalGetCompositions({\n\t\tpuppeteerInstance,\n\t\tenvVariables,\n\t\ttimeoutInMilliseconds,\n\t\tchromiumOptions,\n\t\tport,","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cli/src/get-composition-id.ts#L119-L155","documentation":"Thrown by getCompositionId after RenderInternals.internalSelectComposition returns a falsy config for the requested composition id. Remotion loads your entry point in a browser, collects the registered compositions, and if the id you passed is not among them it cannot proceed.","triggerScenarios":"Passing --id or a positional composition name that is not registered via <Composition id=\"...\"> or registerRoot in the entry point. The composition is conditionally registered (e.g. behind a feature flag) and the flag is off. A typo or wrong casing in the id.","commonSituations":"Renaming a composition id but not the render command; dynamic composition ids that resolve differently at bundle time; env-conditional registration; copy-pasting a command from a different project.","solutions":["List registered compositions to confirm the exact id: `npx remotion compositions <entry-point>`.","Match the id exactly, including casing.","If the composition is conditionally registered, ensure the env/flag that gates it is set the same way at render time as in Studio.","Check the entry point is the one you expect (see the FoundReason from findEntryPoint)."],"exampleFix":"// before\n$ npx remotion render src/index.tsx myomposition out.mp4   // typo\n// after\n$ npx remotion render src/index.tsx myComposition out.mp4","handlingStrategy":"validation","validationCode":"import {getCompositions} from '@remotion/renderer';\n\nconst ensureComposition = async (serveUrl: string, id: string) => {\n  const comps = await getCompositions(serveUrl, {inputProps: {}});\n  if (!comps.some((c) => c.id === id)) {\n    throw new Error(`Composition '${id}' not registered. Available: ${comps.map(c => c.id).join(', ')}`);\n  }\n};\n\nawait ensureComposition(bundleServeUrl, compositionId);","typeGuard":"const isRegisteredComposition = (comps: {id: string}[], id: string): boolean =>\n  comps.some((c) => c.id === id);","tryCatchPattern":"try {\n  await renderMedia(...);\n} catch (err) {\n  if (err instanceof Error && /Cannot find composition with ID/.test(err.message)) {\n    // list available compositions and surface a helpful message\n  }\n  throw err;\n}","preventionTips":["Call getCompositions (or `remotion compositions`) once and cache the id list.","Treat composition ids as case-sensitive identifiers.","Avoid conditional registration of compositions; if needed, gate them by a stable env flag."],"tags":["cli","composition","render","config"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}