remotion-dev/remotion · error · Error

Config.addElementLibrary() expects the display name to not b

Error message

Config.addElementLibrary() expects the display name to not be empty

What it means

displayName must not be empty or whitespace-only after trimming. Passing '' or ' ' throws.

Source

Thrown at packages/cli/src/config/element-libraries.ts:52

			`Config.addElementLibrary() expects an absolute URL, got ${JSON.stringify(url)}`,
		);
	}

	if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {
		throw new Error(
			`Config.addElementLibrary() only supports HTTP and HTTPS URLs, got ${JSON.stringify(url)}`,
		);
	}

	if (displayName !== undefined && typeof displayName !== 'string') {
		throw new Error(
			`Config.addElementLibrary() expects the display name to be a string, got ${typeof displayName}`,
		);
	}

	const trimmedDisplayName = displayName?.trim() ?? null;
	if (trimmedDisplayName === '') {
		throw new Error(
			'Config.addElementLibrary() expects the display name to not be empty',
		);
	}

	elementLibraries.push({
		displayName: trimmedDisplayName,
		url: parsedUrl.href,
	});
};

export const getElementLibraries = (): readonly StudioElementLibrary[] =>
	elementLibraries;

export const resetElementLibraries = () => {
	elementLibraries = [];
};

View on GitHub (pinned to 8f97758157)

Solutions

  1. Omit displayName when you have no name to show
  2. Pass null/undefined instead of an empty string
  3. Trim user input and fall back to omitting if empty

Example fix

// before
Config.addElementLibrary({url, displayName: ''});

// after
Config.addElementLibrary({url});
Defensive patterns

Strategy: validation

Validate before calling

const trimmed = displayName?.trim();
const opts = trimmed ? {url, displayName: trimmed} : {url};

Prevention

When it happens

Trigger: Config.addElementLibrary({url, displayName: ''}) or displayName: ' '.

Common situations: Optional displayName built from an empty variable (e.g. an unset package name) instead of being omitted.

Related errors


AI-assisted analysis of remotion-dev/remotion@8f97758157 (2026-08-28). Data as JSON: /api/errors/99549694fc308775. Report an issue: GitHub.