{"record":{"id":"8fff1fb4d660eabe","repo":"bevyengine/bevy","slug":"vertex-attribute-0-doesn-t-exist","errorCode":null,"errorMessage":"Vertex attribute {0:?} doesn't exist","messagePattern":"Vertex attribute (.+?) doesn't exist","errorType":"validation","errorClass":"MeshAttributeCompressionError","httpStatus":null,"severity":"error","filePath":"crates/bevy_mesh/src/mesh.rs","lineNumber":3177,"sourceCode":"                        warn!(\n                            \"Deserialized mesh contains custom vertex attribute {attribute:?} that \\\n                            was not specified with `MeshDeserializer::add_custom_vertex_attribute`. Ignoring.\"\n                        );\n                        return None;\n                    };\n                    Some((id, data))\n                })\n                .collect()),\n            indices: serialized_mesh.indices.into(),\n            ..Mesh::new(serialized_mesh.primitive_topology, RenderAssetUsages::default())\n        }\n    }\n}\n\n/// Error that can occur when compressing/quantizing mesh vertex attributes.\n#[derive(Error, Debug, Clone)]\npub enum MeshAttributeCompressionError {\n    #[error(\"Vertex attribute {0:?} doesn't exist\")]\n    MissingAttribute(MeshVertexAttributeId),\n    #[error(\"Vertex attribute {0:?} must not be empty\")]\n    EmptyAttribute(MeshVertexAttribute),\n    #[error(\n        \"Vertex attribute {attr:?} must have format {expected:?} before compressing/quantizing\"\n    )]\n    UnsupportedAttributeForCompression {\n        attr: MeshVertexAttribute,\n        expected: VertexFormat,\n    },\n    #[error(\"Vertex attribute {attr:?} must have format `Float32`, `Float32x2` or `Float32x4` before quantizing\")]\n    UnsupportedAttributeForQuantizing { attr: MeshVertexAttribute },\n}\n\n/// Error that can occur when calling [`Mesh::merge_duplicate_vertices`]\n#[derive(Error, Debug, Clone)]\npub enum MeshMergeDuplicateVerticesError {\n    #[error(\"Index attribute already set.\")]","sourceCodeStart":3159,"sourceCodeEnd":3195,"githubUrl":"https://github.com/bevyengine/bevy/blob/8d743eb7dc7fcff57a7d5744d0bbf89620b1b145/crates/bevy_mesh/src/mesh.rs#L3159-L3195","documentation":"MeshAttributeCompressionError::MissingAttribute is thrown when a compression/quantization operation on a Mesh references a vertex attribute id that the mesh does not contain. The library looks up the attribute by MeshVertexAttributeId before compressing it and fails if no such attribute exists in the mesh's attribute table.","triggerScenarios":"Calling Mesh::compress_attribute or Mesh::quantize_attribute with a MeshVertexAttributeId whose attribute was never inserted into the mesh, or was removed, or whose id was constructed with a different format/id than the one stored.","commonSituations":"Typos in custom attribute ids, operating on a mesh loaded from an asset that lacks the attribute, calling compression after removing attributes, or mismatching a locally-defined MeshVertexAttribute constant with the id actually registered on the mesh.","solutions":["Verify the attribute exists before compressing: check mesh.contains_attribute(id) (or try mesh.attribute(id))","Confirm you are using the MeshVertexAttribute constant (whose id matches the one inserted via insert_attribute) and not a separately constructed MeshVertexAttributeId","Ensure the mesh asset you operate on actually carries the attribute (e.g. positions/normals/uv) at that point in the pipeline","Insert or restore the attribute before calling compression APIs"],"exampleFix":"// before\nmesh.compress_attribute(Mesh::ATTRIBUTE_TANGENT.id);\n// after\nif mesh.contains_attribute(Mesh::ATTRIBUTE_TANGENT.id) {\n    mesh.compress_attribute(Mesh::ATTRIBUTE_TANGENT.id);\n}","handlingStrategy":"validation","validationCode":"fn attribute_exists(mesh: &Mesh, id: MeshVertexAttributeId) -> bool {\n    mesh.contains_attribute(id)\n}\n// call only if attribute_exists(&mesh, my_attr.id())","typeGuard":"fn has_attr(mesh: &Mesh, id: MeshVertexAttributeId) -> Option<&MeshVertexAttributeData> {\n    mesh.attribute(id)\n}","tryCatchPattern":"match mesh.compress_attribute(id) {\n    Ok(_) => {},\n    Err(MeshAttributeCompressionError::MissingAttribute(missing)) => {\n        warn!(\"attribute {:?} not present; skipping compression\", missing);\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Always create attributes from the shared MeshVertexAttribute constants so ids match","Check contains_attribute before any per-attribute processing","Validate mesh assets in your asset pipeline before compression passes"],"tags":["bevy","mesh","vertex-attribute","compression"],"backgroundTag":"entity-not-found","analyzedSha":"8d743eb7dc7fcff57a7d5744d0bbf89620b1b145","analyzedAt":"2026-09-13T03:07:18.343Z","contentChangedAt":"2026-09-13T03:07:18.343Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}