remotion-dev/remotion · error · Error

Content-Length header not found

Error message

Content-Length header not found

What it means

Thrown by the internal `downloadFile` helper when the response from `fetch(url)` has no `content-length` header. The helper requires a known total size to drive its progress reporting and validation, so a missing header is a hard error rather than a silent best-effort download.

Source

Thrown at packages/install-whisper-cpp/src/download.ts:27

	signal,
}: {
	fileStream: NodeJS.WritableStream;
	url: string;
	printOutput: boolean;
	onProgress: OnProgress | undefined;
	signal: AbortSignal | null;
}) => {
	const {body, headers} = await fetch(url, {
		signal,
	});
	const contentLength = headers.get('content-length');

	if (body === null) {
		throw new Error('Failed to download whisper model');
	}

	if (contentLength === null) {
		throw new Error('Content-Length header not found');
	}

	let downloaded = 0;
	let lastPrinted = 0;

	const totalFileSize = parseInt(contentLength, 10);

	const reader = body.getReader();
	// eslint-disable-next-line no-async-promise-executor
	await new Promise<void>(async (resolve, reject) => {
		try {
			while (true) {
				const {done, value} = await reader.read();

				if (value) {
					downloaded += value.length;

					if (

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Use the default official URLs (HuggingFace for models, GitHub Releases for whisper.cpp) which include content-length.
  2. If a proxy is stripping the header, bypass it or reconfigure it to preserve `content-length`.
  3. Host the binary on a server/CDN that sends `Content-Length` (e.g. S3 with a known object size).
  4. Retry in case of a transient proxy issue.
Defensive patterns

Strategy: validation

Validate before calling

async function urlReportsLength(url: string): Promise<boolean> {
  const res = await fetch(url, {method: 'HEAD'});
  return res.headers.get('content-length') !== null;
}

if (!await urlReportsLength(modelUrl)) {
  throw new Error('Mirror must send Content-Length; pick the official URL.');
}

Prevention

When it happens

Trigger: The server responds with `Transfer-Encoding: chunked` and no `Content-Length`, or a proxy strips the header. The official HuggingFace and GitHub Release URLs normally include it, so a missing header points at an intermediary.

Common situations: Corporate proxies or firewalls that re-chunk responses; a mirror/CDN that omits content-length; pointing at a custom URL that streams without a known length; HTTP/2 push configurations.

Related errors


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