{"record":{"id":"c5b5c8372465c6c3","repo":"remotion-dev/remotion","slug":"ext-x-map-directive-must-have-a-value","errorCode":null,"errorMessage":"#EXT-X-MAP directive must have a value","messagePattern":"#EXT-X-MAP directive must have a value","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/m3u/parse-directive.ts","lineNumber":131,"sourceCode":"\t\treturn {\n\t\t\ttype: 'm3u-i-frame-stream-info',\n\t\t};\n\t}\n\n\tif (directive === '#EXT-X-ALLOW-CACHE') {\n\t\tif (!value) {\n\t\t\tthrow new Error('#EXT-X-ALLOW-CACHE directive must have a value');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: 'm3u-allow-cache',\n\t\t\tallowsCache: value === 'YES',\n\t\t};\n\t}\n\n\tif (directive === '#EXT-X-MAP') {\n\t\tif (!value) {\n\t\t\tthrow new Error('#EXT-X-MAP directive must have a value');\n\t\t}\n\n\t\tconst p = parseM3uKeyValue(value);\n\t\tif (!p.URI) {\n\t\t\tthrow new Error('EXT-X-MAP directive must have a URI');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: 'm3u-map',\n\t\t\tvalue: p.URI,\n\t\t};\n\t}\n\n\tif (directive === '#EXT-X-PROGRAM-DATE-TIME') {\n\t\tif (!value) {\n\t\t\tthrow new Error('#EXT-X-PROGRAM-DATE-TIME directive must have a value');\n\t\t}\n","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/m3u/parse-directive.ts#L113-L149","documentation":"Thrown by parseM3uDirective() at parse-directive.ts:131 when a line matches #EXT-X-MAP but has no attribute value. The #EXT-X-MAP directive specifies how to obtain the initialization segment (init.mp4) for the media playlist and is required for fMP4/CMAF segment formats. The parser delegates to parseM3uKeyValue() which needs the attribute string.","triggerScenarios":"A playlist line '#EXT-X-MAP' with no colon, or '#EXT-X-MAP:' with empty attributes — no URI=, BYTERANGE= key-value pairs.","commonSituations":"Corrupted init segment declaration in a CMAF/fMP4 media playlist; encoder bug producing an incomplete #EXT-X-MAP line; hand-edited playlist.","solutions":["Ensure the directive includes at least a URI attribute: #EXT-X-MAP:URI=\"init.mp4\"","Regenerate the playlist with a compliant packager","Verify the media playlist was fully received without truncation"],"exampleFix":"// before\n#EXT-X-MAP:\n\n// after\n#EXT-X-MAP:URI=\"init.mp4\"","handlingStrategy":"validation","validationCode":"// Pre-fetch and check EXT-X-MAP has attributes\nconst text = await (await fetch(url)).text();\nfor (const line of text.split('\\n')) {\n  const trimmed = line.trim();\n  if (trimmed.startsWith('#EXT-X-MAP')) {\n    const colonIdx = trimmed.indexOf(':');\n    if (colonIdx === -1 || !trimmed.slice(colonIdx + 1).trim()) {\n      throw new Error('#EXT-X-MAP is missing its attributes');\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({src: url});\n} catch (e) {\n  if (e instanceof Error && e.message.includes('EXT-X-MAP')) {\n    // fix the init segment declaration in the playlist\n  }\n  throw e;\n}","preventionTips":["Ensure CMAF/fMP4 playlists include a valid #EXT-X-MAP:URI=\"...\" directive","Verify the init segment URL is reachable"],"tags":["hls","m3u8","directive","ext-x-map","malformed","initialization-segment"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}