{"record":{"id":"ef672ad056c7c16c","repo":"slint-ui/slint","slug":"can-t-load-style-metrics","errorCode":null,"errorMessage":"can't load style metrics","messagePattern":"can't load style metrics","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/compiler/passes.rs","lineNumber":95,"sourceCode":"        }\n    }\n}\n\npub async fn run_passes(\n    doc: &mut crate::object_tree::Document,\n    type_loader: &mut crate::typeloader::TypeLoader,\n    keep_raw: bool,\n    diag: &mut crate::diagnostics::BuildDiagnostics,\n) -> Option<crate::typeloader::TypeLoader> {\n    let style_metrics = {\n        // Ignore import errors\n        let mut build_diags_to_ignore = crate::diagnostics::BuildDiagnostics::default();\n        // Import from style-base.slint instead of std-widgets.slint to avoid loading\n        // the entire widget library just to get StyleMetrics.\n        type_loader\n            .import_component(\"style-base.slint\", \"StyleMetrics\", &mut build_diags_to_ignore)\n            .await\n            .unwrap_or_else(|| panic!(\"can't load style metrics\"))\n    };\n\n    let palette = {\n        // Ignore import errors\n        let mut build_diags_to_ignore = crate::diagnostics::BuildDiagnostics::default();\n        // Import from style-base.slint instead of std-widgets.slint to avoid loading\n        // the entire widget library just to get Palette.\n        type_loader\n            .import_component(\"style-base.slint\", \"Palette\", &mut build_diags_to_ignore)\n            .await\n            .unwrap_or_else(|| panic!(\"can't load palette\"))\n    };\n\n    let global_type_registry = type_loader.global_type_registry.clone();\n    // The shared symbol-name counters, handed to the passes that generate names.\n    let symbol_counters = type_loader.symbol_counters.clone();\n\n    run_import_passes(doc, type_loader, diag);","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/slint-ui/slint/blob/3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016/internal/compiler/passes.rs#L77-L113","documentation":"Error \"can't load style metrics\" thrown in slint-ui/slint.","triggerScenarios":"Thrown at internal/compiler/passes.rs:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the selected style exists and its metrics file is available in the compiler resources.","Check the style name passed to the compiler."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016","analyzedAt":"2026-08-19T23:23:16.610Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}