{"record":{"id":"5b0fc4f9b1b8a4fd","repo":"bevyengine/bevy","slug":"binary-blob-is-missing","errorCode":null,"errorMessage":"binary blob is missing","messagePattern":"binary blob is missing","errorType":"exception","errorClass":"GltfError","httpStatus":null,"severity":"error","filePath":"crates/bevy_gltf/src/loader/mod.rs","lineNumber":96,"sourceCode":"use crate::convert_coordinates::GltfConvertCoordinates;\n\n/// Must match [`MAX_JOINTS`](https://docs.rs/bevy/latest/bevy/pbr/constant.MAX_JOINTS.html)\npub const MAX_JOINTS: usize = 256;\n\n/// An error that occurs when loading a glTF file.\n#[derive(Error, Debug)]\npub enum GltfError {\n    /// Unsupported primitive mode.\n    #[error(\"unsupported primitive mode\")]\n    UnsupportedPrimitive {\n        /// The primitive mode.\n        mode: Mode,\n    },\n    /// Invalid glTF file.\n    #[error(\"invalid glTF file: {0}\")]\n    Gltf(#[from] gltf::Error),\n    /// Binary blob is missing.\n    #[error(\"binary blob is missing\")]\n    MissingBlob,\n    /// Decoding the base64 mesh data failed.\n    #[error(\"failed to decode base64 mesh data\")]\n    Base64Decode(#[from] base64::DecodeError),\n    /// Unsupported buffer format.\n    #[error(\"unsupported buffer format\")]\n    BufferFormatUnsupported,\n    /// The buffer URI was unable to be resolved with respect to the asset path.\n    #[error(\"invalid buffer uri: {0}. asset path error={1}\")]\n    InvalidBufferUri(String, ParseAssetPathError),\n    /// Invalid image mime type.\n    #[error(\"invalid image mime type: {0}\")]\n    #[from(ignore)]\n    InvalidImageMimeType(String),\n    /// Error when loading a texture. Might be due to a disabled image file format feature.\n    #[error(\"You may need to add the feature for the file format: {0}\")]\n    ImageError(#[from] TextureError),\n    /// The image URI was unable to be resolved with respect to the asset path.","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_gltf/src/loader/mod.rs#L78-L114","documentation":"Raised in load_buffers (loader/mod.rs:1953-1958) when a buffer entry reports gltf::buffer::Source::Bin (JSON buffer with no \"uri\", i.e. buffer 0 of a GLB meant to live in the BIN chunk) but gltf.blob is None. In practice: the JSON declares the binary buffer while the loaded file carries no BIN chunk — typical when a .gltf JSON was extracted from a GLB without its binary, or the BIN chunk header says length 0.","triggerScenarios":"A plain .gltf whose buffers[0] omits \"uri\" (spec allows this only inside GLB); a GLB whose BIN chunk is missing or zero-length while buffers[0] still has no uri; hand-authored JSON copied from a GLB export.","commonSituations":"Splitting a GLB into .gltf + assets by hand, minifiers that drop the BIN chunk reference incorrectly, truncated downloads of .glb files.","solutions":["Re-export as a self-contained .glb so JSON and BIN chunk ship together.","Or keep the .gltf and give the buffer an explicit \"uri\": \"model.bin\" pointing at the extracted binary.","Validate with gltf-validator: it flags BUFFER_MISSING_URI / empty BIN chunk mismatches."],"exampleFix":"// model.gltf (before)\n\"buffers\": [{ \"byteLength\": 1024 }]\n// after: external .bin next to the model\n\"buffers\": [{ \"byteLength\": 1024, \"uri\": \"model.bin\" }]","handlingStrategy":"validation","validationCode":"fn buffer_needs_missing_blob(json: &serde_json::Value, is_glb: bool) -> bool {\n    let buffers = json[\"buffers\"].as_array();\n    !is_glb\n        && buffers.is_some_and(|bs| {\n            bs.first().is_some_and(|b| b.get(\"uri\").is_none())\n        })\n}","typeGuard":null,"tryCatchPattern":"match err {\n    GltfError::MissingBlob => {\n        error!(\"JSON references a GLB BIN chunk that is absent; re-export as .glb or add a buffer uri\");\n    }\n    other => return Err(other.into()),\n}","preventionTips":["Ship GLB for binary meshes; keep .gltf only with explicit .bin uris.","Never extract JSON out of a GLB without its BIN chunk.","gltf-validator in the asset pipeline catches missing-uri buffers."],"tags":["gltf","glb","buffer","binary-blob","bevy"],"backgroundTag":"missing-binary-blob","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}