{"record":{"id":"676b5534675fa9b7","repo":"remotion-dev/remotion","slug":"ext-x-allow-cache-directive-must-have-a-value","errorCode":null,"errorMessage":"#EXT-X-ALLOW-CACHE directive must have a value","messagePattern":"#EXT-X-ALLOW-CACHE directive must have a value","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/m3u/parse-directive.ts","lineNumber":120,"sourceCode":"\n\tif (directive === '#EXT-X-STREAM-INF') {\n\t\tif (!value) {\n\t\t\tthrow new Error('EXT-X-STREAM-INF directive must have a value');\n\t\t}\n\n\t\tconst res = parseStreamInf(value);\n\t\treturn res;\n\t}\n\n\tif (directive === '#EXT-X-I-FRAME-STREAM-INF') {\n\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","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/m3u/parse-directive.ts#L102-L138","documentation":"Thrown by parseM3uDirective() at parse-directive.ts:120 when a line matches #EXT-X-ALLOW-CACHE but has no value. This directive was deprecated in HLS protocol version 7 (RFC 8216 appendix D) but the parser still handles it for backward compatibility. The value must be YES or NO.","triggerScenarios":"A legacy playlist line '#EXT-X-ALLOW-CACHE' with no colon, or '#EXT-X-ALLOW-CACHE:' with an empty value.","commonSituations":"Old playlists generated by legacy encoders that still emit this deprecated directive; hand-edited legacy files; packagers targeting very old HLS clients.","solutions":["Remove the deprecated #EXT-X-ALLOW-CACHE directive entirely (it was removed in protocol version 7)","If keeping it for legacy compat, provide a value: #EXT-X-ALLOW-CACHE:YES","Regenerate with a modern packager that omits this directive"],"exampleFix":"// before\n#EXT-X-ALLOW-CACHE\n\n// after (option 1: remove the line entirely)\n// after (option 2: provide a value)\n#EXT-X-ALLOW-CACHE:YES","handlingStrategy":"validation","validationCode":"// Pre-fetch and strip the deprecated EXT-X-ALLOW-CACHE directive\nconst text = await (await fetch(url)).text();\nconst cleaned = text\n  .split('\\n')\n  .filter((line) => !line.trim().startsWith('#EXT-X-ALLOW-CACHE'))\n  .join('\\n');\n// pass cleaned text as a Blob to parseMedia","typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({src: url});\n} catch (e) {\n  if (e instanceof Error && e.message.includes('EXT-X-ALLOW-CACHE')) {\n    // strip the deprecated directive from the playlist\n  }\n  throw e;\n}","preventionTips":["Remove the deprecated #EXT-X-ALLOW-CACHE directive from playlists (removed in protocol version 7)","Use a modern packager that does not emit this directive"],"tags":["hls","m3u8","directive","ext-x-allow-cache","malformed","deprecated"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}