remotion-dev/remotion · error · Error

The repo parameter must be an https://github.com URL.

Error message

The repo parameter must be an https://github.com URL.

What it means

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.

Source

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

	'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 ||
		![owner, repo].every((part) => /^[a-zA-Z0-9_.-]+$/.test(part))
	) {
		throw new Error(`Invalid GitHub repository URL: ${repoUrl}`);
	}

View on GitHub (pinned to 10db9de073)

Solutions

  1. Use exactly https://github.com/owner/repo (no www., no http://)
  2. Convert SSH URLs (git@github.com:owner/repo.git) to the https form before passing them
  3. For non-GitHub forges, clone the repo locally and open it in desktop Remotion Studio instead

Example fix

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

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

Strategy: validation

Validate before calling

const parsed = (() => {
  try {
    return new URL(repoUrl);
  } catch {
    return null;
  }
})();
if (!parsed || parsed.protocol !== 'https:' || parsed.hostname !== 'github.com') {
  throw new Error('repo must be an exact https://github.com URL (no www, no http, no other host)');
}

Type guard

const isGitHubHttpsUrl = (value: string): boolean => {
  try {
    const u = new URL(value);
    return u.protocol === 'https:' && u.hostname === 'github.com';
  } catch {
    return false;
  }
};

Try / catch

try {
  await loadGitHubRepository({repoUrl});
} catch (e) {
  if (/must be an https:\/\/github.com URL/.test(String((e as Error).message))) {
    // normalize: strip www., force https, convert git@... SSH forms, then retry
  } else throw e;
}

Prevention

When it happens

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

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

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/046f10f09aa6c981. Report an issue: GitHub.