{"record":{"id":"f8bfdd8d5683b90b","repo":"bevyengine/bevy","slug":"23501","errorCode":"-23501","errorMessage":"Resource is not registered: `{}`","messagePattern":"Resource is not registered: `(.+?)`","errorType":"error_code","errorClass":"BrpError","httpStatus":null,"severity":"error","filePath":"crates/bevy_remote/src/builtin_methods.rs","lineNumber":1157,"sourceCode":") -> BrpResult {\n    let BrpInsertResourcesParams {\n        resource: resource_path,\n        value,\n    } = parse_some(params)?;\n\n    let app_type_registry = world.resource::<AppTypeRegistry>().clone();\n    let type_registry = app_type_registry.read();\n\n    let reflected_resource = deserialize_resource(&type_registry, &resource_path, value)\n        .map_err(BrpError::resource_error)?;\n\n    let resource_registration = get_resource_type_registration(&type_registry, &resource_path)\n        .map_err(BrpError::resource_error)?;\n    let type_id = resource_registration.type_id();\n    let resource_id = world\n        .components()\n        .get_id(type_id)\n        .ok_or(anyhow!(\"Resource is not registered: `{}`\", resource_path))\n        .map_err(BrpError::resource_error)?;\n    world.insert_reflect_resource(resource_id, reflected_resource);\n\n    Ok(Value::Null)\n}\n\n/// Handles a `world.mutate_components` request coming from a client.\n///\n/// This method allows you to mutate a single field inside an Entity's\n/// component.\npub fn process_remote_mutate_components_request(\n    In(params): In<Option<Value>>,\n    world: &mut World,\n) -> BrpResult {\n    let BrpMutateComponentsParams {\n        entity,\n        component,\n        path,","sourceCodeStart":1139,"sourceCodeEnd":1175,"githubUrl":"https://github.com/bevyengine/bevy/blob/78002f65fa984ededb80915b4a5613f195bc864d/crates/bevy_remote/src/builtin_methods.rs#L1139-L1175","documentation":"BRP's `world.insert_resource` handler resolves the type path in the AppTypeRegistry (deserialization already succeeded), then asks `world.components().get_id(type_id)` for the resource's component id. In Bevy, a type only gets a component id once the world has initialized it (typically `app.init_resource::<T>()`); if that never happened, `get_id` returns None and this RESOURCE_ERROR (-23501) is returned.","triggerScenarios":"Sending `world.insert_resource` with a type path that is registered for reflection but was never initialized in the target World — e.g. no `init_resource::<T>()` / prior insertion exists on the app being inspected.","commonSituations":"Trying to remotely create a brand-new resource type that the app never declared; app built with `default-features = false` or a minimal plugin set so the resource isn't initialized; type path spelling almost right (deserialization found the type, so this is specifically the world-registration step that failed).","solutions":["On the app side, call `app.init_resource::<MyResource>()` for the type before remote clients insert it","Verify you actually need insertion: if the resource exists, use `world.mutate_resource` instead","Re-send with the exact fully-qualified type path after confirming the resource is initialized (a `world.get_resource` probe returning data proves it)"],"exampleFix":"// before: app never initializes the resource\nApp::new().add_plugins(DefaultPlugins); // BRP insert_resource -> -23501\n\n// after: declare the resource so the World registers its component id\nApp::new()\n    .add_plugins(DefaultPlugins)\n    .init_resource::<MyResource>(); // now remote insert/mutate works","handlingStrategy":"validation","validationCode":"// Client: prove the resource is initialized before inserting\nconst probe = await brpCall(\"world.get_resource\", { resource: path });\nif (probe.error && probe.error.code === -23502 /* RESOURCE_NOT_PRESENT */) {\n  await ensureAppInitializes(path); // app must init_resource::<T>() first\n}","typeGuard":null,"tryCatchPattern":"if (res.error?.code === -23501 && /not registered/i.test(res.error.message)) {\n  // type known to reflection but not initialized in the world -> app-side fix needed\n  reportNeedsInitResource(path);\n}","preventionTips":["Call app.init_resource::<T>() for every resource type remote tools may create or mutate","Keep client and app resource schemas in sync via a startup handshake that probes expected resources","Remember: register_type is not enough for insert_resource — the world needs the component id"],"tags":["bevy","brp","bevy-remote","resources","reflection","world-registration"],"backgroundTag":null,"analyzedSha":"78002f65fa984ededb80915b4a5613f195bc864d","analyzedAt":"2026-08-16T09:07:20.800Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}