remotion-dev/remotion · error · Error

playbackRate must be one of: ${commonPlaybackRates.join(', '

Error message

playbackRate must be one of: ${commonPlaybackRates.join(', ')}.

What it means

The playback-rate MCP tool only accepts rates from the fixed list commonPlaybackRates (e.g. typical Remotion rates like 0.5, 1, 2, 4). Any other number or type throws.

Source

Thrown at packages/studio/src/components/WebMcp.tsx:1730

						type: 'object',
						properties: {
							playbackRate: {
								type: 'number',
								enum: commonPlaybackRates,
								description:
									'The playback multiplier. Negative values play backwards.',
							},
						},
						required: ['playbackRate'],
						additionalProperties: false,
					},
					annotations: {readOnlyHint: false},
					execute: ({playbackRate}) => {
						if (
							typeof playbackRate !== 'number' ||
							!commonPlaybackRates.includes(playbackRate)
						) {
							throw new Error(
								`playbackRate must be one of: ${commonPlaybackRates.join(', ')}.`,
							);
						}

						const compositionId = currentCompositionRef.current;
						if (compositionId === null) {
							throw new Error('No composition is currently selected.');
						}

						setPlaybackRate(() => playbackRate);
						persistPlaybackRate(playbackRate);
						return Promise.resolve({
							currentContent: currentContentRef.current,
							playbackRate,
						});
					},
				},
				{signal: controller.signal},

View on GitHub (pinned to b2f4e34732)

Solutions

  1. Pass one of the documented common playback rates listed in the error message

Example fix

// before
{"playbackRate": 1.5}
// after
{"playbackRate": 2}
Defensive patterns

Strategy: validation

Validate before calling

const rates = [0.25, 0.5, 1, 2, 4]; // match commonPlaybackRates
if (!rates.includes(playbackRate)) throw new Error('unsupported rate');

Type guard

const isCommonRate = (v: unknown): v is number => typeof v === 'number' && commonPlaybackRates.includes(v);

Prevention

When it happens

Trigger: Passing playbackRate such as 1.5, 3, or a string that is not in the allowed set.

Common situations: Clients assuming arbitrary rates are supported, or using rates offered by other video players.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of remotion-dev/remotion@b2f4e34732 (2026-08-28). Data as JSON: /api/errors/d511ab7c03e99e07. Report an issue: GitHub.