slint-ui/slint · error · Diagnostic

Could not load

Error message

Could not load {}: {}

What it means

Error "Could not load {}: {}" thrown in slint-ui/slint.

Solutions

  1. Check that the file exists and is readable at the reported path.
  2. Fix the underlying I/O error shown in the second message part.

When it happens

Trigger: Thrown at internal/compiler/diagnostics.rs:204 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/836fa4c13e782884. Report an issue: GitHub.

Appendix: source

Thrown at internal/compiler/diagnostics.rs:204

        level: DiagnosticLevel::Error,
    })?;

    if path.extension().is_some_and(|e| e == "rs") {
        return crate::lexer::extract_rust_macro(string).ok_or_else(|| Diagnostic {
            message: "No `slint!` macro".into(),
            span: SourceLocation {
                source_file: Some(SourceFileInner::from_path_only(path.to_owned())),
                span: Default::default(),
            },
            level: DiagnosticLevel::Error,
        });
    }

    Ok(string)
}

#[derive(Debug, Clone, Default)]
pub struct SourceLocation {
    pub source_file: Option<SourceFile>,
    pub span: Span,
}

impl Spanned for SourceLocation {
    fn span(&self) -> Span {
        self.span.clone()
    }

    fn source_file(&self) -> Option<&SourceFile> {
        self.source_file.as_ref()
    }
}

impl Spanned for Option<SourceLocation> {
    fn span(&self) -> crate::diagnostics::Span {
        self.as_ref().map(|n| n.span()).unwrap_or_default()
    }

View on GitHub (pinned to 3a7e700487)