{"record":{"id":"44b2ab0498745bec","repo":"remotion-dev/remotion","slug":"the-github-url-must-point-to-a-repository-for-exa","errorCode":null,"errorMessage":"The GitHub URL must point to a repository, for example https://github.com/remotion-dev/template-audiogram.","messagePattern":"The GitHub URL must point to a repository, for example https://github\\.com/remotion-dev/template-audiogram\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/load-github-repository.ts","lineNumber":70,"sourceCode":"const maximumRepositoryBytes = 100 * 1024 * 1024;\nconst maximumRepositoryFiles = 2_000;\nconst downloadConcurrency = 8;\n\nconst parseGitHubRepositoryUrl = (repoUrl: string) => {\n\tlet url: URL;\n\ttry {\n\t\turl = new URL(repoUrl);\n\t} catch {\n\t\tthrow new Error(`Invalid GitHub repository URL: ${repoUrl}`);\n\t}\n\n\tif (url.protocol !== 'https:' || url.hostname !== 'github.com') {\n\t\tthrow new Error('The repo parameter must be an https://github.com URL.');\n\t}\n\n\tconst pathSegments = url.pathname.split('/').filter(Boolean);\n\tif (pathSegments.length !== 2) {\n\t\tthrow new Error(\n\t\t\t'The GitHub URL must point to a repository, for example https://github.com/remotion-dev/template-audiogram.',\n\t\t);\n\t}\n\n\tconst owner = pathSegments[0];\n\tconst repo = pathSegments[1].replace(/\\.git$/, '');\n\tif (\n\t\t!owner ||\n\t\t!repo ||\n\t\t![owner, repo].every((part) => /^[a-zA-Z0-9_.-]+$/.test(part))\n\t) {\n\t\tthrow new Error(`Invalid GitHub repository URL: ${repoUrl}`);\n\t}\n\n\treturn {owner, repo};\n};\n\nconst getResponseError = async (response: Response) => {","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/remotion-dev/remotion/blob/10db9de07356446fb0edb3c3ae211369b693d18b/packages/browser-studio/src/load-github-repository.ts#L52-L88","documentation":"After parsing, url.pathname must split into exactly two non-empty segments (owner and repo). URLs with one segment (a bare user profile), zero segments, or three or more (deep links such as /owner/repo/tree/main/src/index.ts) fail this check. The URL must point at the repository root, not at any file or subpage inside it.","triggerScenarios":"Calling loadGitHubRepository with https://github.com/owner (profile page), https://github.com/ (root), https://github.com/owner/repo/tree/main, https://github.com/owner/repo/blob/main/src/index.ts, or /owner/repo/issues/123.","commonSituations":"Copying a deep URL from GitHub's file browser or address bar while browsing code, or linking an issues/pulls page instead of the repo landing page.","solutions":["Link to the repository root: https://github.com/owner/repo","Strip suffixes like /tree/main, /blob/main/..., /issues, /pull from the URL","Verify the URL has exactly two path segments: owner and repo name"],"exampleFix":"// before\nawait loadGitHubRepository({repoUrl: 'https://github.com/remotion-dev/template-audiogram/tree/main'});\n\n// after\nawait loadGitHubRepository({repoUrl: 'https://github.com/remotion-dev/template-audiogram'});","handlingStrategy":"validation","validationCode":"const {pathname} = new URL(repoUrl);\nconst segments = pathname.split('/').filter(Boolean);\nif (segments.length !== 2) {\n  throw new Error('Link to the repository root (owner/repo), not a file, tree, or subpage');\n}","typeGuard":"const isRepoRootUrl = (value: string): value is `https://github.com/${string}/${string}` => {\n  try {\n    return new URL(value).pathname.split('/').filter(Boolean).length === 2;\n  } catch {\n    return false;\n  }\n};","tryCatchPattern":"try {\n  await loadGitHubRepository({repoUrl});\n} catch (e) {\n  if (/must point to a repository/.test(String((e as Error).message))) {\n    // truncate the pathname to owner/repo and retry\n  } else throw e;\n}","preventionTips":["Strip /tree/..., /blob/..., /issues and similar suffixes from copied URLs before passing them","Auto-truncate any github.com URL to its first two path segments in your UI"],"tags":["browser-studio","github","url","repository"],"backgroundTag":"invalid-url","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"}