{"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":"        // 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);\n    check_public_api::check_public_api(doc, &type_loader.compiler_config, diag);\n\n    let raw_type_loader =\n        keep_raw.then(|| crate::typeloader::snapshot_with_extra_doc(type_loader, doc).unwrap());\n\n    let mut forwarded_references =\n        crate::object_tree::forward_inherited_expression::ForwardedReferenceCache::default();\n\n    // Inject debug hooks early — before any lowering or inlining — so source element identity\n    // is preserved and hooks can be attributed to the correct source location.\n    if let Some(random_state) = &type_loader.compiler_config.debug_hooks {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/slint-ui/slint/blob/3a7e700487dc74d404cad0726378053ab763d4e0/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":"3a7e700487dc74d404cad0726378053ab763d4e0","analyzedAt":"2026-08-19T23:23:16.610Z","contentChangedAt":"2026-08-19T23:23:16.610Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}