{"record":{"id":"e421a245e06ee21b","repo":"bevyengine/bevy","slug":"invalid-image-uri-0-asset-path-error-1","errorCode":null,"errorMessage":"invalid image uri: {0}. asset path error={1}","messagePattern":"invalid image uri: (.+?)\\. asset path error=(.+?)","errorType":"exception","errorClass":"GltfError","httpStatus":null,"severity":"error","filePath":"crates/bevy_gltf/src/loader/mod.rs","lineNumber":115,"sourceCode":"    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.\n    #[error(\"invalid image uri: {0}. asset path error={1}\")]\n    InvalidImageUri(String, ParseAssetPathError),\n    /// Failed to read bytes from an asset path.\n    #[error(\"failed to read bytes from an asset path: {0}\")]\n    ReadAssetBytesError(#[from] ReadAssetBytesError),\n    /// Failed to load asset from an asset path.\n    #[error(\"failed to load asset from an asset path: {0}\")]\n    AssetLoadError(#[from] AssetLoadError),\n    /// Missing sampler for an animation.\n    #[error(\"Missing sampler for animation {0}\")]\n    #[from(ignore)]\n    MissingAnimationSampler(usize),\n    /// Failed to generate tangents.\n    #[error(\"failed to generate tangents: {0}\")]\n    GenerateTangentsError(#[from] bevy_mesh::GenerateTangentsError),\n    /// Failed to generate morph targets.\n    #[error(\"failed to generate morph targets: {0}\")]\n    MorphTarget(#[from] bevy_mesh::morph::MorphBuildError),\n    /// Circular children in Nodes","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_gltf/src/loader/mod.rs#L97-L133","documentation":"Raised at loader/mod.rs:1261-1263 when a texture's source is a plain URI (not a data:) and LoadContext::resolve_embed_str(uri) fails, producing InvalidImageUri(uri, ParseAssetPathError). Like buffers, image URIs must resolve to a child path of the glTF asset; absolute URLs/paths or malformed relative references fail here.","triggerScenarios":"\"images\": [{ \"uri\": \"https://cdn.example.com/albedo.png\" }] or an absolute \"/textures/albedo.png\"; a relative uri that escapes the asset root; mismatched path separators.","commonSituations":"Web-origin models keeping CDN texture links; folders reorganized after export; textures renamed without updating the glTF JSON.","solutions":["Download the textures and point uris at files shipped next to the model (\"textures/albedo.png\").","Keep the exporter's directory layout untouched.","Use '/' separators and relative paths.","Prefer GLB with embedded textures for portable assets."],"exampleFix":"// (before)\n\"images\": [{ \"uri\": \"https://cdn.example.com/albedo.png\" }]\n// (after)\n\"images\": [{ \"uri\": \"textures/albedo.png\" }]","handlingStrategy":"validation","validationCode":"fn image_uris_local(json: &serde_json::Value) -> bool {\n    json[\"images\"].as_array().unwrap_or(&vec![]).iter()\n        .filter_map(|i| i[\"uri\"].as_str())\n        .filter(|u| !u.starts_with(\"data:\"))\n        .all(|u| !u.contains(\"://\") && !u.starts_with('/'))\n}","typeGuard":null,"tryCatchPattern":"match err {\n    GltfError::InvalidImageUri(uri, e) => {\n        error!(\"image uri {uri} cannot resolve under the asset path ({e}); ship the texture next to the model\");\n    }\n    other => return Err(other.into()),\n}","preventionTips":["Keep texture files next to the .gltf with original relative names.","Replace remote/absolute image uris during import.","Prefer embedded-texture GLBs for downloadable assets."],"tags":["gltf","uri","asset-path","image","bevy"],"backgroundTag":"invalid-asset-uri","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T20:17:18.057Z"}