{"record":{"id":"99549694fc308775","repo":"remotion-dev/remotion","slug":"config-addelementlibrary-expects-the-display-nam-995496","errorCode":null,"errorMessage":"Config.addElementLibrary() expects the display name to not be empty","messagePattern":"Config\\.addElementLibrary\\(\\) expects the display name to not be empty","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/config/element-libraries.ts","lineNumber":52,"sourceCode":"\t\t\t`Config.addElementLibrary() expects an absolute URL, got ${JSON.stringify(url)}`,\n\t\t);\n\t}\n\n\tif (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {\n\t\tthrow new Error(\n\t\t\t`Config.addElementLibrary() only supports HTTP and HTTPS URLs, got ${JSON.stringify(url)}`,\n\t\t);\n\t}\n\n\tif (displayName !== undefined && typeof displayName !== 'string') {\n\t\tthrow new Error(\n\t\t\t`Config.addElementLibrary() expects the display name to be a string, got ${typeof displayName}`,\n\t\t);\n\t}\n\n\tconst trimmedDisplayName = displayName?.trim() ?? null;\n\tif (trimmedDisplayName === '') {\n\t\tthrow new Error(\n\t\t\t'Config.addElementLibrary() expects the display name to not be empty',\n\t\t);\n\t}\n\n\telementLibraries.push({\n\t\tdisplayName: trimmedDisplayName,\n\t\turl: parsedUrl.href,\n\t});\n};\n\nexport const getElementLibraries = (): readonly StudioElementLibrary[] =>\n\telementLibraries;\n\nexport const resetElementLibraries = () => {\n\telementLibraries = [];\n};\n","sourceCodeStart":34,"sourceCodeEnd":69,"githubUrl":"https://github.com/remotion-dev/remotion/blob/8f9775815716e25b2a9fd9c5511015a17624243d/packages/cli/src/config/element-libraries.ts#L34-L69","documentation":"displayName must not be empty or whitespace-only after trimming. Passing '' or '   ' throws.","triggerScenarios":"Config.addElementLibrary({url, displayName: ''}) or displayName: '   '.","commonSituations":"Optional displayName built from an empty variable (e.g. an unset package name) instead of being omitted.","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"],"exampleFix":"// before\nConfig.addElementLibrary({url, displayName: ''});\n\n// after\nConfig.addElementLibrary({url});","handlingStrategy":"validation","validationCode":"const trimmed = displayName?.trim();\nconst opts = trimmed ? {url, displayName: trimmed} : {url};","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit displayName rather than passing empty strings","Trim and check user-provided names before config"],"tags":["config","element-library","display-name","validation"],"backgroundTag":"empty-string-argument","analyzedSha":"8f9775815716e25b2a9fd9c5511015a17624243d","analyzedAt":"2026-08-28T15:39:09.316Z","contentChangedAt":"2026-08-28T15:39:09.316Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}