{"record":{"id":"e6c40b99b141b53a","repo":"getzola/zola","slug":"sass-path-conflict-and-both-compile-to","errorCode":null,"errorMessage":"SASS path conflict: \"{}\" and \"{}\" both compile to \"{}\"","messagePattern":"SASS path conflict: \"(.+?)\" and \"(.+?)\" both compile to \"(.+?)\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"components/site/src/sass.rs","lineNumber":43,"sourceCode":"    for file in files {\n        let css = compile_file(&file, &options).map_err(|e| anyhow!(e))?;\n\n        let path_inside_sass = file.strip_prefix(&sass_path).unwrap();\n        let parent_inside_sass = path_inside_sass.parent();\n        let css_output_path = output_path.join(path_inside_sass).with_extension(\"css\");\n\n        if parent_inside_sass.is_some() {\n            fs::create_dir_all(css_output_path.parent().unwrap())?;\n        }\n\n        create_file(&css_output_path, &css)?;\n        compiled_paths.push((path_inside_sass.to_owned(), css_output_path));\n    }\n\n    compiled_paths.sort();\n    for window in compiled_paths.windows(2) {\n        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","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/getzola/zola/blob/61d30828217957120309db657950224edf9707e2/components/site/src/sass.rs#L25-L61","documentation":"`compile_sass` compiles every file under `sass/` and computes each output CSS path. After sorting, it checks adjacent pairs of compiled outputs; if two distinct SASS source paths map to the same CSS output path, it bails because one output file would silently overwrite the other.","triggerScenarios":"Two files in the sass directory tree whose names normalize to the same output path — classically `foo.scss` and `foo.sass` in the same directory, or partial/non-partial naming collisions that compile to identical `foo.css` targets.","commonSituations":"Having both `styles.scss` and `styles.sass`; case-insensitive filesystems where `Foo.scss` and `foo.scss` collide; copying a theme's sass files over existing ones with a different extension.","solutions":["Find the two conflicting paths from the error message and delete or rename one of them","Rename one file so each compiles to a unique CSS output name","Ensure you don't mix `.scss` and `.sass` extensions for the same logical stylesheet"],"exampleFix":"// before\nsass/styles.scss\nsass/styles.sass\n// after\nsass/styles.scss\nsass/legacy.sass   # renamed so outputs differ","handlingStrategy":"validation","validationCode":"fn sass_outputs_unique(files: &[PathBuf]) -> bool {\n    let mut outs: Vec<PathBuf> = files.iter().map(|p| css_output_for(p)).collect();\n    outs.sort();\n    outs.windows(2).all(|w| w[0] != w[1])\n}","typeGuard":null,"tryCatchPattern":"match compile_sass(&site) {\n    Ok(paths) => use(paths),\n    Err(e) if e.to_string().contains(\"SASS path conflict\") => {\n        let names: Vec<&str> = e.to_string().split('\"').collect();\n        report_conflict(&names); // surfaces the two colliding files\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Never keep both foo.scss and foo.sass for the same stylesheet","Use unique base names across the sass/ tree","Watch for case-insensitive filesystem collisions (Foo.scss vs foo.scss)"],"tags":["rust","sass","build","path-collision"],"backgroundTag":"output-path-collision","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"}