remotion-dev/remotion · error · Error

Cannot find composition with ID "${compNameResult.compName}"

Error message

Cannot find composition with ID "${compNameResult.compName}"

What it means

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.

Source

Thrown at packages/cli/src/get-composition-id.ts:137

				onServeUrlVisited: () => undefined,
				chromeMode,
				mediaCacheSizeInBytes,
			});

		if (propsSize > 10_000_000) {
			Log.warn(
				{
					indent,
					logLevel,
				},
				`The props of your composition are large (${StudioServerInternals.formatBytes(
					propsSize,
				)}). This may cause slowdown.`,
			);
		}

		if (!config) {
			throw new Error(
				`Cannot find composition with ID "${compNameResult.compName}"`,
			);
		}

		return {
			compositionId: compNameResult.compName,
			reason: compNameResult.reason,
			config,
			argsAfterComposition: compNameResult.remainingArgs,
		};
	}

	const comps = await RenderInternals.internalGetCompositions({
		puppeteerInstance,
		envVariables,
		timeoutInMilliseconds,
		chromiumOptions,
		port,

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. List registered compositions to confirm the exact id: `npx remotion compositions <entry-point>`.
  2. Match the id exactly, including casing.
  3. If the composition is conditionally registered, ensure the env/flag that gates it is set the same way at render time as in Studio.
  4. Check the entry point is the one you expect (see the FoundReason from findEntryPoint).

Example fix

// before
$ npx remotion render src/index.tsx myomposition out.mp4   // typo
// after
$ npx remotion render src/index.tsx myComposition out.mp4
Defensive patterns

Strategy: validation

Validate before calling

import {getCompositions} from '@remotion/renderer';

const ensureComposition = async (serveUrl: string, id: string) => {
  const comps = await getCompositions(serveUrl, {inputProps: {}});
  if (!comps.some((c) => c.id === id)) {
    throw new Error(`Composition '${id}' not registered. Available: ${comps.map(c => c.id).join(', ')}`);
  }
};

await ensureComposition(bundleServeUrl, compositionId);

Type guard

const isRegisteredComposition = (comps: {id: string}[], id: string): boolean =>
  comps.some((c) => c.id === id);

Try / catch

try {
  await renderMedia(...);
} catch (err) {
  if (err instanceof Error && /Cannot find composition with ID/.test(err.message)) {
    // list available compositions and surface a helpful message
  }
  throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/393856170944c62d. Report an issue: GitHub.