remotion-dev/remotion · error · Error

Could not download ${file.path}: ${await getResponseError(re

Error message

Could not download ${file.path}: ${await getResponseError(response)}

What it means

Each repository file is fetched from https://raw.githubusercontent.com/{owner}/{repo}/{treeSha}/{path} with 8 concurrent workers. A non-2xx response for an individual file - usually a transient 5xx on the raw CDN, throttling from the parallel fetching, or a race where the repo changed between the tree listing and the download - aborts the whole load: already-written OPFS public files are deleted before the error propagates.

Source

Thrown at packages/browser-studio/src/load-github-repository.ts:225

			totalBytes,
			totalFiles,
		});
	reportDownloadProgress();

	let nextFileIndex = 0;
	try {
		await Promise.all(
			Array.from(
				{length: Math.min(downloadConcurrency, fileEntries.length)},
				async () => {
					while (nextFileIndex < fileEntries.length) {
						const file = fileEntries[nextFileIndex++];
						const response = await fetch(
							`https://raw.githubusercontent.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/${encodeURIComponent(treeSha)}/${encodePath(file.path)}`,
							{signal},
						);
						if (!response.ok) {
							throw new Error(
								`Could not download ${file.path}: ${await getResponseError(response)}`,
							);
						}

						let loadedByteLength = file.size ?? 0;
						if (file.path.startsWith('public/') && publicFileStorage) {
							const contents = response.body ?? (await response.blob());
							const storedFile = await writeBrowserStudioStoredPublicFile({
								contents,
								storage: publicFileStorage,
							});
							publicFiles[file.path.slice('public/'.length)] = storedFile;
							loadedByteLength = storedFile.sizeInBytes;
						} else {
							const contents = new Uint8Array(await response.arrayBuffer());
							loadedByteLength = contents.byteLength;
							if (file.path.startsWith('public/')) {
								publicFiles[file.path.slice('public/'.length)] = contents;

View on GitHub (pinned to 10db9de073)

Solutions

  1. Retry the load - raw.githubusercontent.com intermittently returns transient errors
  2. Verify the named file still exists in the repository at HEAD
  3. Avoid pushing commits to the repository while someone is loading it in Browser Studio
Defensive patterns

Strategy: retry

Try / catch

const downloadError = (e: unknown) => /Could not download /.test(String((e as Error).message));
for (let attempt = 0; attempt < 3; attempt++) {
  try {
    return await loadGitHubRepository({repoUrl, signal});
  } catch (e) {
    if (!downloadError(e) || attempt === 2) throw e;
    await new Promise((r) => setTimeout(r, 1500 * (attempt + 1)));
  }
}
throw new Error('unreachable');

Prevention

When it happens

Trigger: During the downloading-files phase of loadGitHubRepository: raw.githubusercontent.com returns 5xx or 403 for one file; the file was renamed/deleted at HEAD after the tree snapshot; aggressive corporate filtering blocks raw.githubusercontent.com mid-run.

Common situations: Flaky network moments, raw CDN hiccups, pushing to the repo while someone is loading it, or networks that allow api.github.com but interfere with raw.githubusercontent.com.

Related errors


AI-assisted analysis of remotion-dev/remotion@10db9de073 (2026-08-22). Data as JSON: /api/errors/4f543d4ba9c3cf50. Report an issue: GitHub.