remotion-dev/remotion · error · Error

did not calculate natural duration, this is an error with Re

Error message

did not calculate natural duration, this is an error with Remotion. Please report

What it means

spring() builds a naturalDurationGetter: a real getter when needsToCalculateNaturalDuration is true, otherwise a getter that throws this internal error. The throw fires if reverse mode needs the natural duration (e.g. reverse=true and passedDurationInFrames is undefined) but the duration was never calculated. The message explicitly calls this a Remotion bug to report.

Source

Thrown at packages/core/src/spring/index.ts:59

	const needsToCalculateNaturalDuration =
		reverse || typeof passedDurationInFrames !== 'undefined';

	const naturalDuration = needsToCalculateNaturalDuration
		? measureSpring({
				fps,
				config,
				threshold: durationRestThreshold,
			})
		: undefined;

	const naturalDurationGetter = needsToCalculateNaturalDuration
		? {
				get: () => naturalDuration as number,
			}
		: {
				get: () => {
					throw new Error(
						'did not calculate natural duration, this is an error with Remotion. Please report',
					);
				},
			};

	const reverseProcessed = reverse
		? (passedDurationInFrames ?? naturalDurationGetter.get()) - passedFrame
		: passedFrame;

	const delayProcessed = reverseProcessed + (reverse ? delay : -delay);

	const durationProcessed =
		passedDurationInFrames === undefined
			? delayProcessed
			: delayProcessed / (passedDurationInFrames / naturalDurationGetter.get());

	if (passedDurationInFrames && delayProcessed > passedDurationInFrames) {
		return to;

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Report the bug to Remotion with a minimal reproduction.
  2. Pass durationInFrames explicitly so the getter is not consulted.
  3. Compute the duration with measureSpring() and pass it through.

Example fix

// before
spring({ frame, fps, config, reverse: true })
// after
spring({ frame, fps, config, reverse: true, durationInFrames: 60 })
Defensive patterns

Strategy: validation

Validate before calling

// Avoid the unset getter by always passing durationInFrames with reverse:
const sp = spring({ frame, fps, config, reverse, durationInFrames: 60 });

Prevention

When it happens

Trigger: Calling spring() with reverse=true and no passedDurationInFrames, hitting the thrower getter via `passedDurationInFrames ?? naturalDurationGetter.get()`.

Common situations: Edge-case combination of reverse spring without an explicit duration; an API path that sets needsToCalculateNaturalDuration=false while reverse still needs it.

Related errors


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