DioxusLabs/dioxus · error

Encoding not found.

Error message

Encoding not found.

What it means

While resolving the encoding shorthand in the #[server] macro arguments, the provided encoding name did not match any builtin (Json, Cbor, GetUrl, PostUrl, Getcbor, etc.) or resolvable encoding type, so the macro cannot determine how to serialize requests and responses.

Solutions

  1. Use one of the encodings supported by the server macro (e.g. the default JSON encoding); check the `encoding` value for typos.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/fullstack-macro/src/lib.rs:1752 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23). Data as JSON: /api/errors/416d8d306f5af07f. Report an issue: GitHub.

Appendix: source

Thrown at packages/fullstack-macro/src/lib.rs:1752

                    output = Some(type_from_ident(syn::parse_quote!(Json)));
                    builtin_encoding = true;
                }
                "cbor" => {
                    input = Some(type_from_ident(syn::parse_quote!(Cbor)));
                    output = Some(type_from_ident(syn::parse_quote!(Cbor)));
                    builtin_encoding = true;
                }
                "getcbor" => {
                    input = Some(type_from_ident(syn::parse_quote!(GetUrl)));
                    output = Some(type_from_ident(syn::parse_quote!(Cbor)));
                    builtin_encoding = true;
                }
                "getjson" => {
                    input = Some(type_from_ident(syn::parse_quote!(GetUrl)));
                    output = Some(syn::parse_quote!(Json));
                    builtin_encoding = true;
                }
                _ => return Err(syn::Error::new(encoding.span(), "Encoding not found.")),
            }
        }

        Ok(Self {
            struct_name,
            prefix,
            input,
            input_derive,
            output,
            fn_path,
            builtin_encoding,
            server,
            client,
            custom_wrapper,
            impl_from,
            impl_deref,
            protocol,
            server_args,

View on GitHub (pinned to 24f6a829df)