{"record":{"id":"4c0db5fb0ec3d933","repo":"remotion-dev/remotion","slug":"owner-repo-has-fileentries-length-tolocale","errorCode":null,"errorMessage":"${owner}/${repo} has ${fileEntries.length.toLocaleString()} files. Browser Studio supports up to ${maximumRepositoryFiles.toLocaleString()}.","messagePattern":"(.+?)/(.+?) has (.+?) files\\. Browser Studio supports up to (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/load-github-repository.ts","lineNumber":176,"sourceCode":"\t}\n\n\tconst treeSha = tree.sha;\n\n\tif (tree.truncated) {\n\t\tthrow new Error(\n\t\t\t`${owner}/${repo} has too many files for Browser Studio to load.`,\n\t\t);\n\t}\n\n\tconst fileEntries = tree.tree.filter(\n\t\t(entry): entry is GitHubTreeEntry & {type: 'blob'} => entry.type === 'blob',\n\t);\n\tfor (const file of fileEntries) {\n\t\tvalidateRepositoryPath(file.path);\n\t}\n\n\tif (fileEntries.length > maximumRepositoryFiles) {\n\t\tthrow new Error(\n\t\t\t`${owner}/${repo} has ${fileEntries.length.toLocaleString()} files. Browser Studio supports up to ${maximumRepositoryFiles.toLocaleString()}.`,\n\t\t);\n\t}\n\n\tconst totalBytes = fileEntries.reduce(\n\t\t(total, entry) => total + (entry.size ?? 0),\n\t\t0,\n\t);\n\tif (totalBytes > maximumRepositoryBytes) {\n\t\tthrow new Error(\n\t\t\t`${owner}/${repo} is larger than the 100 MB Browser Studio limit.`,\n\t\t);\n\t}\n\n\tlet loadedBytes = 0;\n\tlet loadedFiles = 0;\n\tconst files: Record<string, string> = {};\n\tconst publicFiles: Record<string, VirtualProjectPublicFile> = {};","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/remotion-dev/remotion/blob/10db9de07356446fb0edb3c3ae211369b693d18b/packages/browser-studio/src/load-github-repository.ts#L158-L194","documentation":"After filtering the GitHub tree to blobs, loadGitHubRepository enforces maximumRepositoryFiles = 2_000. A repository with more tracked files than that is rejected with the exact count and the limit in the message. The check runs after per-path validation but before any bytes are downloaded.","triggerScenarios":"Calling loadGitHubRepository on a repository whose tree contains more than 2,000 blob entries - e.g. committed node_modules, build artifacts, or an asset-heavy project; fileEntries.length > maximumRepositoryFiles triggers the throw.","commonSituations":"Monorepos; repos with generated output checked in; design-heavy projects with thousands of images; users expecting a full app repository to load into a browser sandbox.","solutions":["Reduce the repository to 2,000 tracked files or fewer (remove build output, vendored deps, unused assets)","Point Browser Studio at a slim template repo instead of a large monorepo","Check the count beforehand with: git ls-files | wc -l"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await loadGitHubRepository({repoUrl, onProgress});\n} catch (e) {\n  const msg = String((e as Error).message);\n  if (/supports up to/.test(msg)) {\n    // the message contains the actual count; guide the user to prune below 2,000 files\n  } else throw e;\n}","preventionTips":["Check file count with git ls-files | wc -l before sharing a repo link","Add .gitignore entries for build output and vendored dependencies","Curate a minimal demo/template repo for Browser Studio instead of a full project"],"tags":["browser-studio","github","repository-size","file-count"],"backgroundTag":"repository-size-limit-exceeded","analyzedSha":"10db9de07356446fb0edb3c3ae211369b693d18b","analyzedAt":"2026-08-22T21:45:17.748Z","contentChangedAt":"2026-08-22T21:45:17.748Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}