{"record":{"id":"8ab7d01eb50740f3","repo":"DioxusLabs/dioxus","slug":"css-module-file-should-end-with-a-css-suff","errorCode":null,"errorMessage":"Css module file `{}` should end with a `.css` suffix.","messagePattern":"Css module file `(.+?)` should end with a `\\.css` suffix\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/opt/css.rs","lineNumber":65,"sourceCode":"    css_options: &CssModuleAssetOptions,\n    source: &Path,\n    output_path: &Path,\n) -> anyhow::Result<()> {\n    let css = std::fs::read_to_string(source)?;\n\n    // Collect the file hash name.\n    let mut src_name = source\n        .file_name()\n        .and_then(|x| x.to_str())\n        .ok_or_else(|| {\n            anyhow!(\n                \"Failed to read name of css module file `{}`.\",\n                source.display()\n            )\n        })?\n        .strip_suffix(\".css\")\n        .ok_or_else(|| {\n            anyhow!(\n                \"Css module file `{}` should end with a `.css` suffix.\",\n                source.display(),\n            )\n        })?\n        .to_string();\n\n    src_name.push('-');\n\n    let hash = create_module_hash(source);\n    let css = transform_css(css.as_str(), hash.as_str()).map_err(|error| {\n        anyhow!(\n            \"Invalid css for file `{}`\\nError:\\n{}\",\n            source.display(),\n            error\n        )\n    })?;\n\n    // Minify CSS","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/opt/css.rs#L47-L83","documentation":"Guard in process_css_module when strip_suffix(\".css\") fails, i.e. the asset passed to the CSS module pipeline does not end with a `.css` extension. The faulting input is the source path; CSS module assets must be named *.css for the hash-name scheme to work.","triggerScenarios":"Thrown at packages/cli/src/opt/css.rs:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["CSS module files must end with .css. Rename the file with a .css suffix."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}