DioxusLabs/dioxus · error

op skip exceeds packed op capacity

Error message

op skip exceeds packed op capacity

What it means

TemplateOp packs an enter op's child-skip count into a u16 alongside opcode bits, capping it at MAX_CAP (16383). A template element with more skipped children than fits overflows the packed representation, so this guard fires at compile time when the RSX template is lowered.

Solutions

  1. Internal template packing limit hit. Split the oversized template into smaller components; 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:18 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/32f6e3f6ad0b5f31. Report an issue: GitHub.

Appendix: source

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

/// One operation in a flat static template tape.
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
pub(crate) struct TemplateOp(u16);

impl TemplateOp {
    const ENTER_MAX_CODE: u16 = 0x7fff;
    const ATTR_CODE: u16 = 0x8000;
    const ATTR_CUSTOM_NS_CODE: u16 = 0x8001;
    const TEXT_CODE: u16 = 0x8002;
    const STATIC_BASE: u16 = 0x8003;
    pub(crate) const MAX_CAP: usize = 16_383;

    /// Create a packed enter op.
    pub(crate) const fn enter(skip: u16, namespace: bool) -> Self {
        if skip as usize > Self::MAX_CAP {
            panic!("op skip exceeds packed op capacity");
        }
        Self((skip << 1) | namespace as u16)
    }

    /// 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)
    }

View on GitHub (pinned to 24f6a829df)