{"record":{"id":"c3e6cf3e7c3ce1fd","repo":"remotion-dev/remotion","slug":"unexpected-type","errorCode":null,"errorMessage":"Unexpected type","messagePattern":"Unexpected type","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/webm/segments/block-simple-block-flags.ts","lineNumber":51,"sourceCode":"\t\titerator.startReadingBits();\n\n\t\tconst keyframe = Boolean(iterator.getBits(1));\n\t\t// Reserved\n\t\titerator.getBits(3);\n\t\tconst invisible = Boolean(iterator.getBits(1));\n\t\tconst lacing = iterator.getBits(2);\n\t\titerator.getBits(1);\n\n\t\titerator.stopReadingBits();\n\n\t\treturn {\n\t\t\tinvisible,\n\t\t\tlacing,\n\t\t\tkeyframe,\n\t\t};\n\t}\n\n\tthrow new Error('Unexpected type');\n};\n","sourceCodeStart":33,"sourceCodeEnd":53,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/webm/segments/block-simple-block-flags.ts#L33-L53","documentation":"parseBlockFlags throws if the supplied element type is neither matroskaElements.Block nor matroskaElements.SimpleBlock. The function's TypeScript signature already narrows the input to those two, so reaching the throw requires either an exhaustiveness leak or a value constructed with the wrong enum constant.","triggerScenarios":"Internal caller passes a type that does not equal the Block or SimpleBlock enum constants (e.g. a string compare mismatch after an enum refactor, or a BlockGroup child that was misidentified as a block). Not reachable through normal file input given the type guard upstream.","commonSituations":"A library regression after changes to matroskaElements constants, or a corrupted block child whose type field was mutated. Effectively a defensive guard.","solutions":["Upgrade or pin @remotion/media-parser to a version where this is not reachable.","Re-mux the input file in case a corrupted child element confused the dispatcher.","Report to Remotion maintainers with the file and version, and use Mediabunny."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({src: 'in.webm', fields: {samples: true}});\n} catch (err) {\n  if (err instanceof Error && err.message === 'Unexpected type') {\n    throw new Error('Internal block-flag dispatch failure; upgrade @remotion/media-parser or re-mux the file.', {cause: err});\n  }\n  throw err;\n}","preventionTips":["Pin a known-good @remotion/media-parser version.","Re-mux the source to normalize block elements.","Report the file to Remotion maintainers."],"tags":["webm","matroska","media-parser","block","internal-invariant"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}