{"record":{"id":"110de7fd84e858c1","repo":"bevyengine/bevy","slug":"lib","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_settings/src/lib.rs","lineNumber":498,"sourceCode":"                ty.type_info().type_path()\n            ));\n            continue;\n        };\n\n        // If no filename is specified, use \"settings\"\n        let filename = reflect_group.settings_source.unwrap_or(\"settings\");\n        let pending_file = file_index\n            .files\n            .entry(filename)\n            .or_insert(SettingsFileManifest {\n                last_save,\n                resource_types: Vec::new(),\n            });\n        pending_file.last_save = last_save;\n        pending_file.resource_types.push(ty.type_id());\n    }\n    if !errors.is_empty() {\n        panic!(\"{}\", errors.join(\"\\n\"));\n    }\n\n    file_index\n}\n\n/// Loads a single settings file and applies its values to the world's resources.\nfn load_settings_file(\n    world: &mut World,\n    app_name: &str,\n    filename: &str,\n    manifest: &SettingsFileManifest,\n    types: &TypeRegistry,\n) {\n    // Load the TOML file\n    let store = SettingsStore::new(app_name);\n    let toml = store.load(filename);\n    if toml.is_none() {\n        warn!(\"Filename {filename}.toml not found\");","sourceCodeStart":480,"sourceCodeEnd":516,"githubUrl":"https://github.com/bevyengine/bevy/blob/a62cce8c05ceacd3bd102e678c83e2b42e5dfbe2/crates/bevy_settings/src/lib.rs#L480-L516","documentation":"build_settings_registry in bevy_settings accumulates errors while building the settings registry (e.g. duplicate resource types, conflicting groups/files) and panics by joining them with newlines if any occurred. It's a fail-fast registration-time panic surfacing multiple settings-definition problems at once.","triggerScenarios":"Calling Settings::build / build_settings_registry where settings definitions conflict — e.g. the same resource type declared in multiple files or groups, or invalid settings file definitions — producing a non-empty errors vec.","commonSituations":"Two settings files mapping to the same Rust resource; merging groups that duplicate resource_type entries; test builds combining settings from separate files that overlap.","solutions":["Read the joined panic message — it lists each conflicting entry — and remove the duplicate resource type declarations","Assign each resource type to exactly one settings file/group","Split settings into distinct resources so merged groups don't collide"],"exampleFix":"// before\n// both files declare\n#[derive(Settings)] struct PlayerSettings; // registered twice\n\n// after\n// keep PlayerSettings in one file/group only, or rename one to UniquePlayerSettings","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"let result = std::panic::catch_unwind(|| Settings::build(app));\nif let Err(e) = result { eprintln!(\"Settings registry build failed: {:?}\", e); }","preventionTips":["Keep one settings file/group per resource type","Check for duplicate resource declarations when merging groups","Cover registry builds in tests so conflicts surface early"],"tags":["bevy","settings","configuration"],"backgroundTag":"conflicting-config-options","analyzedSha":"a62cce8c05ceacd3bd102e678c83e2b42e5dfbe2","analyzedAt":"2026-09-19T21:23:06.616Z","contentChangedAt":"2026-09-19T21:23:06.616Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}