DioxusLabs/dioxus · error

expected `html`

Error message

expected `html`

What it means

The `DefineElements` parser expects the syntax `html = <path>, ...` inside the element-definition macro; this error fires when the identifier after `core = ...` is not `html`. A misspelled or missing `html` marker in the macro invocation causes this compile error.

Source

Thrown at packages/html-internal-macro/src/elements.rs:53

#[derive(Default)]
struct ElementMetadata {
    name: Option<LitStr>,
    namespace: Option<LitStr>,
}

impl Parse for DefineElements {
    fn parse(input: ParseStream) -> syn::Result<Self> {
        let core_marker: Ident = input.parse()?;
        if core_marker != "core" {
            return Err(syn::Error::new(core_marker.span(), "expected `core`"));
        }
        input.parse::<Token![=]>()?;
        let core_path = input.parse()?;
        input.parse::<Token![,]>()?;

        let html_marker: Ident = input.parse()?;
        if html_marker != "html" {
            return Err(syn::Error::new(html_marker.span(), "expected `html`"));
        }
        input.parse::<Token![=]>()?;
        let html_path = input.parse()?;

        let mut hot_reload_context = false;
        while input.peek(Token![,]) {
            input.parse::<Token![,]>()?;
            if input.peek(Token![;]) {
                break;
            }

            let option: Ident = input.parse()?;
            input.parse::<Token![=]>()?;
            let enabled: LitBool = input.parse()?;
            if option == "hot_reload_context" {
                hot_reload_context = enabled.value;
            } else {
                return Err(syn::Error::new(

View on GitHub (pinned to 24f6a829df)

Solutions

  1. Pass `html` as the expected argument; this internal macro expects the literal `html` in this position.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/html-internal-macro/src/elements.rs:53 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/9e5c7de3841b6c95. Report an issue: GitHub.