{"record":{"id":"046f10f09aa6c981","repo":"remotion-dev/remotion","slug":"the-repo-parameter-must-be-an-https-github-com-u","errorCode":null,"errorMessage":"The repo parameter must be an https://github.com URL.","messagePattern":"The repo parameter must be an https://github\\.com URL\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/load-github-repository.ts","lineNumber":65,"sourceCode":"\t'src/remotion/index.ts',\n\t'src/remotion/index.js',\n\t'src/remotion/index.mjs',\n];\n\nconst 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}","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/remotion-dev/remotion/blob/10db9de07356446fb0edb3c3ae211369b693d18b/packages/browser-studio/src/load-github-repository.ts#L47-L83","documentation":"The repo URL parsed successfully, but load-github-repository.ts requires protocol 'https:' and a hostname exactly equal to 'github.com'. Anything else - http://, ssh://, git@github.com:owner/repo.git, another forge like gitlab.com, or even www.github.com (the hostname comparison is exact) - is rejected.","triggerScenarios":"Calling loadGitHubRepository with http://github.com/..., https://www.github.com/... (www fails the exact-host check), an ssh:// or scp-style git clone URL, or a URL pointing at GitLab, Bitbucket, or a GitHub Enterprise host.","commonSituations":"Pasting the SSH clone string from GitHub's Code button; bookmarks and search engines that normalize links to www.github.com; users assuming any GitHub mirror URL works.","solutions":["Use exactly https://github.com/owner/repo (no www., no http://)","Convert SSH URLs (git@github.com:owner/repo.git) to the https form before passing them","For non-GitHub forges, clone the repo locally and open it in desktop Remotion Studio instead"],"exampleFix":"// before\nawait loadGitHubRepository({repoUrl: 'https://www.github.com/remotion-dev/template-audiogram'});\n\n// after\nawait loadGitHubRepository({repoUrl: 'https://github.com/remotion-dev/template-audiogram'});","handlingStrategy":"validation","validationCode":"const parsed = (() => {\n  try {\n    return new URL(repoUrl);\n  } catch {\n    return null;\n  }\n})();\nif (!parsed || parsed.protocol !== 'https:' || parsed.hostname !== 'github.com') {\n  throw new Error('repo must be an exact https://github.com URL (no www, no http, no other host)');\n}","typeGuard":"const isGitHubHttpsUrl = (value: string): boolean => {\n  try {\n    const u = new URL(value);\n    return u.protocol === 'https:' && u.hostname === 'github.com';\n  } catch {\n    return false;\n  }\n};","tryCatchPattern":"try {\n  await loadGitHubRepository({repoUrl});\n} catch (e) {\n  if (/must be an https:\\/\\/github.com URL/.test(String((e as Error).message))) {\n    // normalize: strip www., force https, convert git@... SSH forms, then retry\n  } else throw e;\n}","preventionTips":["Normalize pasted URLs: strip www., convert SSH clone strings to https","Only offer GitHub.com repositories in your UI; other forges are unsupported","Exact-host compare in your own validation to match the library's behavior"],"tags":["browser-studio","github","url","https"],"backgroundTag":"invalid-url","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"}