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
- Omit displayName when you have no name to show
- Pass null/undefined instead of an empty string
- 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
- Omit displayName rather than passing empty strings
- Trim and check user-provided names before config
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
- Config.addElementLibrary() expects the display name to be a
- Config.addElementLibrary() expects an object, got ${received
- Config.addElementLibrary() expects "url" to be a string, got
- Config.addElementLibrary() expects an absolute URL, got ${JS
- Config.addElementLibrary() only supports HTTP and HTTPS URLs
AI-assisted analysis of remotion-dev/remotion@8f97758157 (2026-08-28).
Data as JSON: /api/errors/99549694fc308775.
Report an issue: GitHub.