{"record":{"id":"544bd93c7ccc5e1a","repo":"bevyengine/bevy","slug":"requested-resource-does-not-exist-in-the-world-544bd9","errorCode":null,"errorMessage":"Requested resource {} does not exist in the `World`.\\n                Did you forget to add it using `app.insert_resource` / `app.init_resource`?\\n                Resources are also implicitly added via `app.add_message`,\\n                and can be added by plugins.","messagePattern":"Requested resource (.+?) does not exist in the `World`\\.\\\\n                Did you forget to add it using `app\\.insert_resource` / `app\\.init_resource`\\?\\\\n                Resources are also implicitly added via `app\\.add_message`,\\\\n                and can be added by plugins\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/src/world/mod.rs","lineNumber":2202,"sourceCode":"        let entity_ref = self.get_entity(entity).ok()?;\n        entity_ref.get_change_ticks_by_id(component_id)\n    }\n\n    /// Gets a reference to the resource of the given type\n    ///\n    /// # Panics\n    ///\n    /// Panics if the resource does not exist.\n    /// Use [`get_resource`](World::get_resource) instead if you want to handle this case.\n    ///\n    /// If you want to instead insert a value if the resource does not exist,\n    /// use [`get_resource_or_insert_with`](World::get_resource_or_insert_with).\n    #[inline]\n    #[track_caller]\n    pub fn resource<R: Resource>(&self) -> &R {\n        match self.get_resource() {\n            Some(x) => x,\n            None => panic!(\n                \"Requested resource {} does not exist in the `World`.\n                Did you forget to add it using `app.insert_resource` / `app.init_resource`?\n                Resources are also implicitly added via `app.add_message`,\n                and can be added by plugins.\",\n                DebugName::type_name::<R>()\n            ),\n        }\n    }\n\n    /// Gets a reference to the resource of the given type\n    ///\n    /// # Panics\n    ///\n    /// Panics if the resource does not exist.\n    /// Use [`get_resource_ref`](World::get_resource_ref) instead if you want to handle this case.\n    ///\n    /// If you want to instead insert a value if the resource does not exist,\n    /// use [`get_resource_or_insert_with`](World::get_resource_or_insert_with).","sourceCodeStart":2184,"sourceCodeEnd":2220,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/src/world/mod.rs#L2184-L2220","documentation":"Error \"Requested resource {} does not exist in the `World`.\\n                Did you forget to add it using `app.insert_resource` / `app.init_resource`?\\n                Resources are also implicitly added via `app.add_message`,\\n                and can be added by plugins.\" thrown in bevyengine/bevy.","triggerScenarios":"Thrown at crates/bevy_ecs/src/world/mod.rs:2202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the resource with app.insert_resource(...) / app.init_resource::<R>()","Use world.get_resource::<R>() to handle absence gracefully","Use get_resource_or_insert_with to lazily initialize it"],"exampleFix":null,"handlingStrategy":"type-guard","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"}