bevyengine/bevy · error · GltfError
binary blob is missing
Error message
binary blob is missing
What it means
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.
Source
Thrown at crates/bevy_gltf/src/loader/mod.rs:96
use crate::convert_coordinates::GltfConvertCoordinates;
/// Must match [`MAX_JOINTS`](https://docs.rs/bevy/latest/bevy/pbr/constant.MAX_JOINTS.html)
pub const MAX_JOINTS: usize = 256;
/// An error that occurs when loading a glTF file.
#[derive(Error, Debug)]
pub enum GltfError {
/// Unsupported primitive mode.
#[error("unsupported primitive mode")]
UnsupportedPrimitive {
/// The primitive mode.
mode: Mode,
},
/// Invalid glTF file.
#[error("invalid glTF file: {0}")]
Gltf(#[from] gltf::Error),
/// Binary blob is missing.
#[error("binary blob is missing")]
MissingBlob,
/// Decoding the base64 mesh data failed.
#[error("failed to decode base64 mesh data")]
Base64Decode(#[from] base64::DecodeError),
/// Unsupported buffer format.
#[error("unsupported buffer format")]
BufferFormatUnsupported,
/// The buffer URI was unable to be resolved with respect to the asset path.
#[error("invalid buffer uri: {0}. asset path error={1}")]
InvalidBufferUri(String, ParseAssetPathError),
/// Invalid image mime type.
#[error("invalid image mime type: {0}")]
#[from(ignore)]
InvalidImageMimeType(String),
/// Error when loading a texture. Might be due to a disabled image file format feature.
#[error("You may need to add the feature for the file format: {0}")]
ImageError(#[from] TextureError),
/// The image URI was unable to be resolved with respect to the asset path.View on GitHub (pinned to 396ca72708)
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.
Example fix
// model.gltf (before)
"buffers": [{ "byteLength": 1024 }]
// after: external .bin next to the model
"buffers": [{ "byteLength": 1024, "uri": "model.bin" }] Defensive patterns
Strategy: validation
Validate before calling
fn buffer_needs_missing_blob(json: &serde_json::Value, is_glb: bool) -> bool {
let buffers = json["buffers"].as_array();
!is_glb
&& buffers.is_some_and(|bs| {
bs.first().is_some_and(|b| b.get("uri").is_none())
})
} Try / catch
match err {
GltfError::MissingBlob => {
error!("JSON references a GLB BIN chunk that is absent; re-export as .glb or add a buffer uri");
}
other => return Err(other.into()),
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Splitting a GLB into .gltf + assets by hand, minifiers that drop the BIN chunk reference incorrectly, truncated downloads of .glb files.
Related errors
- failed to decode base64 mesh data
- unsupported buffer format
- invalid buffer uri: {0}. asset path error={1}
- failed to read bytes from an asset path: {0}
- unsupported primitive mode
AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20).
Data as JSON: /api/errors/5b0fc4f9b1b8a4fd.
Report an issue: GitHub.