{"record":{"id":"4f543d4ba9c3cf50","repo":"remotion-dev/remotion","slug":"could-not-download-file-path-await-getrespon","errorCode":null,"errorMessage":"Could not download ${file.path}: ${await getResponseError(response)}","messagePattern":"Could not download (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/load-github-repository.ts","lineNumber":225,"sourceCode":"\t\t\ttotalBytes,\n\t\t\ttotalFiles,\n\t\t});\n\treportDownloadProgress();\n\n\tlet nextFileIndex = 0;\n\ttry {\n\t\tawait Promise.all(\n\t\t\tArray.from(\n\t\t\t\t{length: Math.min(downloadConcurrency, fileEntries.length)},\n\t\t\t\tasync () => {\n\t\t\t\t\twhile (nextFileIndex < fileEntries.length) {\n\t\t\t\t\t\tconst file = fileEntries[nextFileIndex++];\n\t\t\t\t\t\tconst response = await fetch(\n\t\t\t\t\t\t\t`https://raw.githubusercontent.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/${encodeURIComponent(treeSha)}/${encodePath(file.path)}`,\n\t\t\t\t\t\t\t{signal},\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (!response.ok) {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`Could not download ${file.path}: ${await getResponseError(response)}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet loadedByteLength = file.size ?? 0;\n\t\t\t\t\t\tif (file.path.startsWith('public/') && publicFileStorage) {\n\t\t\t\t\t\t\tconst contents = response.body ?? (await response.blob());\n\t\t\t\t\t\t\tconst storedFile = await writeBrowserStudioStoredPublicFile({\n\t\t\t\t\t\t\t\tcontents,\n\t\t\t\t\t\t\t\tstorage: publicFileStorage,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tpublicFiles[file.path.slice('public/'.length)] = storedFile;\n\t\t\t\t\t\t\tloadedByteLength = storedFile.sizeInBytes;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst contents = new Uint8Array(await response.arrayBuffer());\n\t\t\t\t\t\t\tloadedByteLength = contents.byteLength;\n\t\t\t\t\t\t\tif (file.path.startsWith('public/')) {\n\t\t\t\t\t\t\t\tpublicFiles[file.path.slice('public/'.length)] = contents;","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/remotion-dev/remotion/blob/10db9de07356446fb0edb3c3ae211369b693d18b/packages/browser-studio/src/load-github-repository.ts#L207-L243","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Retry the load - raw.githubusercontent.com intermittently returns transient errors","Verify the named file still exists in the repository at HEAD","Avoid pushing commits to the repository while someone is loading it in Browser Studio"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"const downloadError = (e: unknown) => /Could not download /.test(String((e as Error).message));\nfor (let attempt = 0; attempt < 3; attempt++) {\n  try {\n    return await loadGitHubRepository({repoUrl, signal});\n  } catch (e) {\n    if (!downloadError(e) || attempt === 2) throw e;\n    await new Promise((r) => setTimeout(r, 1500 * (attempt + 1)));\n  }\n}\nthrow new Error('unreachable');","preventionTips":["Retry the whole load - individual raw.githubusercontent.com failures are usually transient","Avoid pushing to the repository while a Browser Studio load is in flight","The error names the failing path; verify that file still exists at HEAD if retries keep failing"],"tags":["browser-studio","github","raw","download","network"],"backgroundTag":"remote-file-download-failed","analyzedSha":"10db9de07356446fb0edb3c3ae211369b693d18b","analyzedAt":"2026-08-22T21:45:17.748Z","contentChangedAt":"2026-08-22T21:45:17.748Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}