{"record":{"id":"ba558dc521a3a3c7","repo":"bevyengine/bevy","slug":"the-component-with-id-0-was-requested-mutably","errorCode":null,"errorMessage":"The component with ID {0:?} was requested mutably more than once.","messagePattern":"The component with ID (.+?) was requested mutably more than once\\.","errorType":"exception","errorClass":"EntityComponentError::AliasedMutability","httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/src/world/error.rs","lineNumber":45,"sourceCode":"    /// The bundles' type name.\n    pub bundle_type: DebugName,\n    /// The IDs of the provided entities that do not exist.\n    pub entities: Vec<Entity>,\n}\n\n/// An error that occurs when a specified [`Entity`] could not be despawned.\n#[derive(thiserror::Error, Debug, Clone, Copy)]\n#[error(\"Could not despawn entity: {0}\")]\npub struct EntityDespawnError(#[from] pub EntityNotSpawnedError);\n\n/// An error that occurs when dynamically retrieving components from an entity.\n#[derive(thiserror::Error, Debug, Clone, Copy, PartialEq, Eq)]\npub enum EntityComponentError {\n    /// The component with the given [`ComponentId`] does not exist on the entity.\n    #[error(\"The component with ID {0:?} does not exist on the entity.\")]\n    MissingComponent(ComponentId),\n    /// The component with the given [`ComponentId`] was requested mutably more than once.\n    #[error(\"The component with ID {0:?} was requested mutably more than once.\")]\n    AliasedMutability(ComponentId),\n}\n\n/// An error that occurs when fetching entities mutably from a world.\n#[derive(thiserror::Error, Debug, Clone, Copy, PartialEq, Eq)]\npub enum EntityMutableFetchError {\n    /// The entity is not spawned.\n    #[error(\n        \"{0}\\n\n    If you were attempting to apply a command to this entity,\n    and want to handle this error gracefully, consider using `EntityCommands::queue_handled` or `queue_silenced`.\"\n    )]\n    NotSpawned(#[from] EntityNotSpawnedError),\n    /// The entity with the given ID was requested mutably more than once.\n    #[error(\"The entity with ID {0} was requested mutably more than once\")]\n    AliasedMutability(Entity),\n}\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/src/world/error.rs#L27-L63","documentation":"EntityComponentError::AliasedMutability: a dynamic component fetch asked for mutable access to the same ComponentId more than once in one call, which would create aliasing &mut references.","triggerScenarios":"Thrown at crates/bevy_ecs/src/world/error.rs:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Request each component mutably only once per fetch","Split the mutation into separate sequential operations","Use the read-only fetch for the duplicate access"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}