{"record":{"id":"5f0a13de9d27a7b1","repo":"DioxusLabs/dioxus","slug":"self-type-is-not-supported","errorCode":null,"errorMessage":"Self type is not supported","messagePattern":"Self type is not supported","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/fullstack-macro/src/lib.rs","lineNumber":235,"sourceCode":"                f.span(),\n                \"Expected middleware attribute to be a list, e.g. #[middleware(MyLayer::new())]\",\n            )),\n        })\n        .collect::<Result<Vec<_>>>()?;\n\n    // don't re-emit the middleware attribute on the inner\n    function\n        .attrs\n        .retain(|attr| !attr.path().is_ident(\"middleware\"));\n\n    // Attach `#[allow(unused_mut)]` to all original inputs to avoid warnings\n    let outer_inputs = function\n        .sig\n        .inputs\n        .iter()\n        .enumerate()\n        .map(|(i, arg)| match arg {\n            FnArg::Receiver(_receiver) => panic!(\"Self type is not supported\"),\n            FnArg::Typed(pat_type) => match pat_type.pat.as_ref() {\n                Pat::Ident(_) => {\n                    quote! { #[allow(unused_mut)] #pat_type }\n                }\n                _ => {\n                    let ident = format_ident!(\"___Arg{}\", i);\n                    let ty = &pat_type.ty;\n                    quote! { #[allow(unused_mut)] #ident: #ty }\n                }\n            },\n        })\n        .collect::<Punctuated<_, Token![,]>>();\n    // .collect::<Punctuated<_, Token![,]>>();\n\n    let route = CompiledRoute::from_route(route, &function, false, method_from_macro)?;\n    let query_params_struct = route.query_params_struct(false);\n    let method_ident = &route.method;\n    let body_json_args = route.remaining_pattypes_named(&function.sig.inputs);","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/fullstack-macro/src/lib.rs#L217-L253","documentation":"A fullstack route/middleware macro was applied to a method with a self receiver. The generated server-function plumbing does not support Self types, so encountering FnArg::Receiver in the argument list panics inside route_impl_with_route.","triggerScenarios":"Thrown at packages/fullstack-macro/src/lib.rs:235 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Server function signatures cannot use Self. Name the concrete type explicitly."],"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"}