remotion-dev/remotion · error · Error

Invalid GitHub repository URL: ${repoUrl}

Error message

Invalid GitHub repository URL: ${repoUrl}

What it means

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.

Source

Thrown at packages/browser-studio/src/load-github-repository.ts:61

	'remotion/index.ts',
	'remotion/index.js',
	'remotion/index.mjs',
	'src/remotion/index.tsx',
	'src/remotion/index.ts',
	'src/remotion/index.js',
	'src/remotion/index.mjs',
];

const maximumRepositoryBytes = 100 * 1024 * 1024;
const maximumRepositoryFiles = 2_000;
const downloadConcurrency = 8;

const parseGitHubRepositoryUrl = (repoUrl: string) => {
	let url: URL;
	try {
		url = new URL(repoUrl);
	} catch {
		throw new Error(`Invalid GitHub repository URL: ${repoUrl}`);
	}

	if (url.protocol !== 'https:' || url.hostname !== 'github.com') {
		throw new Error('The repo parameter must be an https://github.com URL.');
	}

	const pathSegments = url.pathname.split('/').filter(Boolean);
	if (pathSegments.length !== 2) {
		throw new Error(
			'The GitHub URL must point to a repository, for example https://github.com/remotion-dev/template-audiogram.',
		);
	}

	const owner = pathSegments[0];
	const repo = pathSegments[1].replace(/\.git$/, '');
	if (
		!owner ||
		!repo ||

View on GitHub (pinned to 10db9de073)

Solutions

  1. Pass the full URL including scheme: https://github.com/owner/repo
  2. Prepend https:// to bare owner/repo input before calling loadGitHubRepository
  3. Validate user-supplied repo values with new URL() in your own UI before invoking the loader

Example fix

// before
await loadGitHubRepository({repoUrl: 'remotion-dev/template-audiogram'});

// after
await loadGitHubRepository({repoUrl: 'https://github.com/remotion-dev/template-audiogram'});
Defensive patterns

Strategy: validation

Validate before calling

const parseable = (() => {
  try {
    new URL(repoUrl);
    return true;
  } catch {
    return false;
  }
})();
if (!parseable) throw new Error('repo URL is not parseable - include the https:// scheme');

Type guard

const isParsableUrl = (value: string): value is `https://${string}` => {
  try {
    return new URL(value).protocol === 'https:';
  } catch {
    return false;
  }
};

Try / catch

try {
  await loadGitHubRepository({repoUrl});
} catch (e) {
  if (/Invalid GitHub repository URL/.test(String((e as Error).message))) {
    // normalize input: prepend https:// when the scheme is missing, then retry
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid URL" / "URL cannot be empty": fix the malformed or missing URL behind request-construction failures — this error's family across 50 libraries.

Related errors


AI-assisted analysis of remotion-dev/remotion@10db9de073 (2026-08-22). Data as JSON: /api/errors/8e93b3c9d870d954. Report an issue: GitHub.