{"record":{"id":"60f95702f8323c89","repo":"slint-ui/slint","slug":"can-t-load-palette","errorCode":null,"errorMessage":"can't load palette","messagePattern":"can't load palette","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/compiler/passes.rs","lineNumber":106,"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    // 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 {\n        for root_component in doc.exported_roots() {\n            inject_debug_hooks::inject_debug_hooks(&root_component, random_state);\n        }","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/slint-ui/slint/blob/3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016/internal/compiler/passes.rs#L88-L124","documentation":"Error \"can't load palette\" thrown in slint-ui/slint.","triggerScenarios":"Thrown at internal/compiler/passes.rs:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the selected style's palette definition is present in the compiler resources.","Pick a supported style via the style option."],"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-14T05:17:10.506Z"}