{"record":{"id":"f2cdd4b9ead9a6a5","repo":"remotion-dev/remotion","slug":"config-addelementlibrary-only-supports-http-and","errorCode":null,"errorMessage":"Config.addElementLibrary() only supports HTTP and HTTPS URLs, got ${JSON.stringify(url)}","messagePattern":"Config\\.addElementLibrary\\(\\) only supports HTTP and HTTPS URLs, got (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/config/element-libraries.ts","lineNumber":39,"sourceCode":"\n\tconst {url, displayName} = options;\n\tif (typeof url !== 'string') {\n\t\tthrow new Error(\n\t\t\t`Config.addElementLibrary() expects \"url\" to be a string, got ${typeof url}`,\n\t\t);\n\t}\n\n\tlet parsedUrl: URL;\n\ttry {\n\t\tparsedUrl = new URL(url);\n\t} catch {\n\t\tthrow new Error(\n\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({","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/remotion-dev/remotion/blob/8f9775815716e25b2a9fd9c5511015a17624243d/packages/cli/src/config/element-libraries.ts#L21-L57","documentation":"Even if the URL parses, addElementLibrary only accepts http: and https: protocols. Other schemes such as file:, data:, or ftp: are rejected.","triggerScenarios":"Passing 'file:///Users/me/library.json' or 'data:application/json,...' as the url option.","commonSituations":"Pointing at a local file during development instead of serving it over HTTP, or pasting a data URL.","solutions":["Serve the library over http(s) (e.g. via a local static server) and use that URL","For local development, use a localhost http URL rather than file://"],"exampleFix":"// before\nConfig.addElementLibrary({url: 'file:///libs/library.json'});\n\n// after\n// serve ./libs via: npx serve libs\nConfig.addElementLibrary({url: 'http://localhost:3000/library.json'});","handlingStrategy":"validation","validationCode":"const proto = new URL(url).protocol;\nif (proto !== 'http:' && proto !== 'https:') { /* serve over http instead */ }","typeGuard":"const isHttpUrl = (u: string) => { try { const p = new URL(u).protocol; return p === 'http:' || p === 'https:'; } catch { return false; } };","tryCatchPattern":null,"preventionTips":["Never use file:// or data: URLs for element libraries","Run a local static server for development assets"],"tags":["config","element-library","protocol","validation"],"backgroundTag":"unsupported-url-scheme","analyzedSha":"8f9775815716e25b2a9fd9c5511015a17624243d","analyzedAt":"2026-08-28T15:39:09.316Z","contentChangedAt":"2026-08-28T15:39:09.316Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}