{"record":{"id":"c38d8b188011d438","repo":"DioxusLabs/dioxus","slug":"failed-emit-valid-rsx-likely-due-to-partially-co","errorCode":null,"errorMessage":"Failed emit valid rsx - likely due to partially complete expressions in the rsx! macro","messagePattern":"Failed emit valid rsx - likely due to partially complete expressions in the rsx! macro","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"packages/autofmt/src/lib.rs","lineNumber":102,"sourceCode":"        // this macro is inside the last macro we parsed, skip it\n        if macro_path.span().start() < end_span {\n            continue;\n        }\n\n        let body = item.parse_body_with(CallBody::parse_strict)?;\n\n        let rsx_start = macro_path.span().start();\n\n        writer.out.indent_level = writer\n            .out\n            .indent\n            .count_indents(writer.src.get(rsx_start.line - 1).unwrap_or(&\"\"));\n\n        // TESTME\n        // Writing *should* not fail but it's possible that it does\n        if writer.write_rsx_call(&body).is_err() {\n            let span = writer.invalid_exprs.pop().unwrap_or_else(Span::call_site);\n            return Err(syn::Error::new(\n                span,\n                \"Failed emit valid rsx - likely due to partially complete expressions in the rsx! macro\",\n            ));\n        }\n\n        // writing idents leaves the final line ended at the end of the last ident\n        if writer.out.buf.contains('\\n') {\n            _ = writer.out.new_line();\n            _ = writer.out.tab();\n        }\n\n        let span = item.delimiter.span().join();\n        let mut formatted = writer.out.buf.split_off(0);\n        let start = collect_macros::byte_offset(contents, span.start()) + 1;\n        let end = collect_macros::byte_offset(contents, span.end()) - 1;\n\n        // Rustfmt will remove the space between the macro and the opening paren if the macro is a single expression\n        let body_is_solo_expr = body.body().roots.len() == 1","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/autofmt/src/lib.rs#L84-L120","documentation":"Raised in autofmt try_fmt_file when write_rsx_call fails after successfully parsing the macro: the formatter could not emit valid rsx for the parsed CallBody. This happens with partially complete expressions inside rsx! — the file is left unformatted rather than corrupted.","triggerScenarios":"Thrown at packages/autofmt/src/lib.rs:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The rsx! macro contains partially complete expressions, so formatting failed. Complete the expressions and re-run the formatter."],"exampleFix":null,"handlingStrategy":"fallback","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"}