{"record":{"id":"befd6c1ae50dbaa6","repo":"slint-ui/slint","slug":"slint-embed-resources-has-incorrect-value-must-be","errorCode":null,"errorMessage":"SLINT_EMBED_RESOURCES has incorrect value. Must be either unset, 'true' or 'false'","messagePattern":"SLINT_EMBED_RESOURCES has incorrect value\\. Must be either unset, 'true' or 'false'","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/compiler/lib.rs","lineNumber":248,"sourceCode":"                .into_owned()\n        });\n        #[cfg(not(feature = \"bundle-translations\"))]\n        return None;\n    }\n\n    pub fn new(output_format: OutputFormat) -> Self {\n        let embed_resources = if std::env::var_os(\"SLINT_EMBED_TEXTURES\").is_some()\n            || std::env::var_os(\"DEP_MCU_BOARD_SUPPORT_MCU_EMBED_TEXTURES\").is_some()\n        {\n            #[cfg(not(feature = \"renderer-software\"))]\n            panic!(\n                \"the renderer-software feature must be enabled in i-slint-compiler when embedding textures\"\n            );\n            #[cfg(feature = \"renderer-software\")]\n            EmbedResourcesKind::EmbedTextures\n        } else if let Ok(var) = std::env::var(\"SLINT_EMBED_RESOURCES\") {\n            let var = var.parse::<bool>().unwrap_or_else(|_|{\n                panic!(\"SLINT_EMBED_RESOURCES has incorrect value. Must be either unset, 'true' or 'false'\")\n            });\n            match var {\n                true => EmbedResourcesKind::EmbedAllResources,\n                false => EmbedResourcesKind::OnlyBuiltinResources,\n            }\n        } else {\n            match output_format {\n                #[cfg(feature = \"rust\")]\n                OutputFormat::Rust => EmbedResourcesKind::EmbedAllResources,\n                OutputFormat::Interpreter => EmbedResourcesKind::Nothing,\n                _ => EmbedResourcesKind::OnlyBuiltinResources,\n            }\n        };\n\n        let inline_all_elements = match std::env::var(\"SLINT_INLINING\") {\n            Ok(var) => var.parse::<bool>().unwrap_or_else(|_| {\n                panic!(\n                    \"SLINT_INLINING has incorrect value. Must be either unset, 'true' or 'false'\"","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/slint-ui/slint/blob/3a7e700487dc74d404cad0726378053ab763d4e0/internal/compiler/lib.rs#L230-L266","documentation":"CompilerConfiguration::new parses the SLINT_EMBED_RESOURCES environment variable as a boolean; if it is set to anything other than 'true' or 'false', parse::<bool>() fails and the code panics. The variable controls whether all resources are embedded in the binary.","triggerScenarios":"Setting SLINT_EMBED_RESOURCES=1, =yes, =TRUE, or any value other than exactly 'true' or 'false' in the environment before running a program that creates a CompilerConfiguration.","commonSituations":"CI/exported environments where someone wrote SLINT_EMBED_RESOURCES=1 (Rust bool parsing only accepts lowercase 'true'/'false'); copy-pasted env setup from shell scripts.","solutions":["Set SLINT_EMBED_RESOURCES to exactly `true` or `false` (lowercase)","Unset SLINT_EMBED_RESOURCES entirely if you want the default behavior","Audit shell/CI profiles (e.g. .bashrc, CI config) for numeric or mixed-case boolean values"],"exampleFix":"// before\nexport SLINT_EMBED_RESOURCES=1\n// after\nexport SLINT_EMBED_RESOURCES=true","handlingStrategy":"validation","validationCode":"if let Some(v) = std::env::var(\"SLINT_EMBED_RESOURCES\").ok() {\n    assert!(matches!(v.as_str(), \"true\" | \"false\"), \"SLINT_EMBED_RESOURCES must be 'true' or 'false', got {v:?}\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only export lowercase 'true'/'false' for Slint boolean env vars","Add an env sanity check to CI setup scripts","Unset the variable rather than setting it to '0'/'1'"],"tags":["env-var","configuration","parsing"],"backgroundTag":"invalid-env-var-value","analyzedSha":"3a7e700487dc74d404cad0726378053ab763d4e0","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}