DioxusLabs/dioxus · error

static op id exceeds packed op capacity

Error message

static op id exceeds packed op capacity

What it means

TemplateOp::static_text packs a static string's index into a u16 with a limited capacity (MAX_CAP). A template referencing more static strings than the packed op can address triggers this panic during template lowering in the macro.

Source

Thrown at packages/core-template/src/op.rs:40

    /// Create a packed static attribute op.
    pub(crate) const fn attr(namespace: bool) -> Self {
        if namespace {
            Self(Self::ATTR_CUSTOM_NS_CODE)
        } else {
            Self(Self::ATTR_CODE)
        }
    }

    /// Create a packed text marker op.
    pub(crate) const fn text() -> Self {
        Self(Self::TEXT_CODE)
    }

    /// Create a packed static string reference op.
    pub(crate) const fn static_text(id: u16) -> Self {
        if id as usize >= Self::MAX_CAP {
            panic!("static op id exceeds packed op capacity");
        }
        Self(Self::STATIC_BASE + id)
    }

    /// Decode this packed op.
    pub(crate) const fn decode(self) -> DecodedTemplateOp {
        if self.0 <= Self::ENTER_MAX_CODE {
            DecodedTemplateOp::Enter {
                skip: self.0 >> 1,
                namespace: self.0 & 1 == 1,
            }
        } else if self.0 == Self::ATTR_CODE {
            DecodedTemplateOp::Attr { namespace: false }
        } else if self.0 == Self::ATTR_CUSTOM_NS_CODE {
            DecodedTemplateOp::Attr { namespace: true }
        } else if self.0 == Self::TEXT_CODE {
            DecodedTemplateOp::Text
        } else {

View on GitHub (pinned to 24f6a829df)

Solutions

  1. Internal template packing limit hit. Split the component into smaller templates; if a normal template triggers this, report a bug to dioxus.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/core-template/src/op.rs:40 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/8c516ec514fb0dc5. Report an issue: GitHub.