{"record":{"id":"399e83faaaca6658","repo":"getzola/zola","slug":"invalid-glob-for-sass","errorCode":null,"errorMessage":"Invalid glob for sass","messagePattern":"Invalid glob for sass","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"components/site/src/sass.rs","lineNumber":60,"sourceCode":"        if window[0].1 == window[1].1 {\n            bail!(\n                \"SASS path conflict: \\\"{}\\\" and \\\"{}\\\" both compile to \\\"{}\\\"\",\n                window[0].0.display(),\n                window[1].0.display(),\n                window[0].1.display(),\n            );\n        }\n    }\n\n    Ok(())\n}\n\nfn is_partial_scss(entry: &DirEntry) -> bool {\n    entry.file_name().to_str().map(|s| s.starts_with('_')).unwrap_or(false)\n}\n\nfn get_non_partial_scss(sass_path: &Path) -> Vec<PathBuf> {\n    let glob = Glob::new(\"*.{sass,scss}\").expect(\"Invalid glob for sass\").compile_matcher();\n\n    WalkDir::new(sass_path)\n        .into_iter()\n        .filter_entry(|e| !is_partial_scss(e))\n        .filter_map(|e| e.ok())\n        .map(|e| e.into_path())\n        .filter(|e| glob.is_match(e))\n        .collect::<Vec<_>>()\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn test_get_non_partial_scss() {\n        use std::env;\n","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/getzola/zola/blob/61d30828217957120309db657950224edf9707e2/components/site/src/sass.rs#L42-L78","documentation":"get_non_partial_scss compiles the hardcoded glob pattern \"*.{sass,scss}\" via the globset crate to find non-partial Sass files. The pattern is fixed in source, so this expect can only fire if the globset version in use cannot parse brace-alternation syntax — i.e. a build with an incompatible/broken globset.","triggerScenarios":"Calling compile_sass (which invokes get_non_partial_scss) when the globset dependency fails to parse the hardcoded pattern — practically only with an unusual globset version/feature regression, since the pattern itself is static.","commonSituations":"A dependency update (globset regression) or a vendored/patched build missing brace expansion support; fork builds with altered globset features.","solutions":["Pin/restore a known-good globset version in Cargo.lock (cargo update -p globset --precise <good-version>).","Verify the error isn't a stale/incomplete build; run cargo clean and rebuild.","If editing the pattern, validate it with Glob::new in a test before shipping.","Replace the hardcoded pattern with a simpler one (e.g. two globs: *.sass, *.scss) if brace syntax is the problem."],"exampleFix":"// before\nlet glob = Glob::new(\"*.{sass,scss}\").expect(\"Invalid glob for sass\").compile_matcher();\n// after\nlet glob = Glob::new(\"*.sass\").expect(\"Invalid glob\").compile_matcher();\nlet glob2 = Glob::new(\"*.scss\").expect(\"Invalid glob\").compile_matcher();","handlingStrategy":"validation","validationCode":"// Validate the glob compiles before relying on it\nif globset::Glob::new(\"*.{sass,scss}\").is_err() {\n    eprintln!(\"globset cannot parse sass glob; check globset version\");\n}","typeGuard":null,"tryCatchPattern":"match Glob::new(\"*.{sass,scss}\") {\n    Ok(g) => g.compile_matcher(),\n    Err(e) => { log::error!(\"bad sass glob: {}\", e); Glob::new(\"*.scss\").unwrap().compile_matcher() }\n}","preventionTips":["Pin a known-good globset version in Cargo.lock.","Test glob patterns in unit tests before releases.","cargo clean and rebuild after dependency upgrades.","Prefer simple patterns over brace alternation if vendoring globset."],"tags":["glob","sass","globset","configuration"],"backgroundTag":"invalid-glob-pattern","analyzedSha":"61d30828217957120309db657950224edf9707e2","analyzedAt":"2026-09-03T14:39:09.727Z","contentChangedAt":"2026-09-03T14:39:09.727Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}