slint-ui/slint · error

can't load palette

Error message

can't load palette

What it means

Error "can't load palette" thrown in slint-ui/slint.

Solutions

  1. Ensure the selected style's palette definition is present in the compiler resources.
  2. Pick a supported style via the style option.

When it happens

Trigger: Thrown at internal/compiler/passes.rs:106 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of slint-ui/slint@3a7e700487 (2026-08-19). Data as JSON: /api/errors/60f95702f8323c89. Report an issue: GitHub.

Appendix: source

Thrown at internal/compiler/passes.rs:106

        // Ignore import errors
        let mut build_diags_to_ignore = crate::diagnostics::BuildDiagnostics::default();
        // Import from style-base.slint instead of std-widgets.slint to avoid loading
        // the entire widget library just to get Palette.
        type_loader
            .import_component("style-base.slint", "Palette", &mut build_diags_to_ignore)
            .await
            .unwrap_or_else(|| panic!("can't load palette"))
    };

    let global_type_registry = type_loader.global_type_registry.clone();
    // The shared symbol-name counters, handed to the passes that generate names.
    let symbol_counters = type_loader.symbol_counters.clone();

    run_import_passes(doc, type_loader, diag);
    check_public_api::check_public_api(doc, &type_loader.compiler_config, diag);

    let raw_type_loader =
        keep_raw.then(|| crate::typeloader::snapshot_with_extra_doc(type_loader, doc).unwrap());

    let mut forwarded_references =
        crate::object_tree::forward_inherited_expression::ForwardedReferenceCache::default();

    // Inject debug hooks early — before any lowering or inlining — so source element identity
    // is preserved and hooks can be attributed to the correct source location.
    if let Some(random_state) = &type_loader.compiler_config.debug_hooks {
        let root_components = doc.exported_roots().collect::<Vec<_>>();
        inject_debug_hooks::inject_debug_hooks(
            &root_components,
            random_state,
            &symbol_counters,
            &mut forwarded_references,
        );
    }

    collect_libraries::collect_libraries(doc);
    collect_subcomponents::collect_subcomponents(doc);

View on GitHub (pinned to 3a7e700487)