{"record":{"id":"8e93b3c9d870d954","repo":"remotion-dev/remotion","slug":"invalid-github-repository-url-repourl","errorCode":null,"errorMessage":"Invalid GitHub repository URL: ${repoUrl}","messagePattern":"Invalid GitHub repository URL: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/load-github-repository.ts","lineNumber":61,"sourceCode":"\t'remotion/index.ts',\n\t'remotion/index.js',\n\t'remotion/index.mjs',\n\t'src/remotion/index.tsx',\n\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 ||","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/remotion-dev/remotion/blob/10db9de07356446fb0edb3c3ae211369b693d18b/packages/browser-studio/src/load-github-repository.ts#L43-L79","documentation":"loadGitHubRepository() starts by parsing the ?repo= parameter with new URL(repoUrl). If the URL constructor throws - the string is empty, lacks a scheme, or is not a URL at all - this error is raised with the offending value echoed back. It is the first of four validation gates on the repo URL.","triggerScenarios":"Calling loadGitHubRepository with a repoUrl that new URL() cannot parse: 'owner/repo' without a scheme, '' (empty), 'github.com/owner/repo', undefined coerced to the string 'undefined', or arbitrary text pasted into the ?repo= parameter.","commonSituations":"Users typing owner/repo shorthand into the Browser Studio URL parameter instead of a full URL; automation passing nullish or malformed values; copy-paste dropping the scheme.","solutions":["Pass the full URL including scheme: https://github.com/owner/repo","Prepend https:// to bare owner/repo input before calling loadGitHubRepository","Validate user-supplied repo values with new URL() in your own UI before invoking the loader"],"exampleFix":"// before\nawait loadGitHubRepository({repoUrl: 'remotion-dev/template-audiogram'});\n\n// after\nawait loadGitHubRepository({repoUrl: 'https://github.com/remotion-dev/template-audiogram'});","handlingStrategy":"validation","validationCode":"const parseable = (() => {\n  try {\n    new URL(repoUrl);\n    return true;\n  } catch {\n    return false;\n  }\n})();\nif (!parseable) throw new Error('repo URL is not parseable - include the https:// scheme');","typeGuard":"const isParsableUrl = (value: string): value is `https://${string}` => {\n  try {\n    return new URL(value).protocol === 'https:';\n  } catch {\n    return false;\n  }\n};","tryCatchPattern":"try {\n  await loadGitHubRepository({repoUrl});\n} catch (e) {\n  if (/Invalid GitHub repository URL/.test(String((e as Error).message))) {\n    // normalize input: prepend https:// when the scheme is missing, then retry\n  } else throw e;\n}","preventionTips":["Run user-supplied repo strings through new URL() in your own UI before calling loadGitHubRepository","Auto-prepend https:// for bare owner/repo input","Reject empty or whitespace-only values early"],"tags":["browser-studio","github","url","parsing"],"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"}