remotion-dev/remotion · error · Error

The Studio canvas is not ready to be measured.

Error message

The Studio canvas is not ready to be measured.

What it means

Thrown by the Studio WebMcp canvas-outline measurement tool when the canvas scale factors (scaleX/scaleY) are non-finite or zero. This means the canvas DOM node exists but has not been laid out yet, so element outlines cannot be converted to canvas coordinates.

Source

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

							compositions: compositionsRef.current,
							timelinePosition: currentFrame,
						});
						const portalNode = Internals.portalNode();
						const portalRect = portalNode.getBoundingClientRect();
						const metadata = currentCompositionMetadataRef.current;
						const compositionWidth =
							metadata?.width ?? composition.width ?? portalNode.offsetWidth;
						const compositionHeight =
							metadata?.height ?? composition.height ?? portalNode.offsetHeight;
						const scaleX = portalRect.width / compositionWidth;
						const scaleY = portalRect.height / compositionHeight;
						if (
							!Number.isFinite(scaleX) ||
							scaleX === 0 ||
							!Number.isFinite(scaleY) ||
							scaleY === 0
						) {
							throw new Error('The Studio canvas is not ready to be measured.');
						}

						const measuredOutlines = measureOutlineTargets(
							portalNode,
							selectableOutlines.map((outline) => {
								if (outline.sequence.refForOutline === null) {
									throw new Error('Expected an outline ref.');
								}

								return {
									key: outline.key,
									ref: outline.sequence.refForOutline,
									crop: {left: 0, right: 0, top: 0, bottom: 0},
									includeOutsideContainer: true,
								};
							}),
						);
						const measurementsByKey = new Map(

View on GitHub (pinned to b2f4e34732)

Solutions

  1. Wait/retry until the canvas is mounted and has non-zero size
  2. Ensure a composition is loaded and the preview area is visible before calling the tool
Defensive patterns

Strategy: retry

Validate before calling

const canvas = document.querySelector('.RemotionCanvas');
if (!canvas || canvas.clientWidth === 0) {
  // wait for layout before calling the outline tool
}

Try / catch

try { await outlineTool(); } catch (e) { if (e.message.includes('not ready to be measured')) await wait(200).then(outlineTool); else throw e; }

Prevention

When it happens

Trigger: Calling the MCP outline/measurement tool immediately after Studio loads, before the canvas has rendered; or when the canvas element is hidden (display:none) or has zero size.

Common situations: Agents invoking the outline tool during initial composition load, before switching compositions, or while the preview is not visible.

Related errors


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