DioxusLabs/dioxus · error

non-empty mounted fragment should have a child range

Error message

non-empty mounted fragment should have a child range

What it means

Internal invariant: the mount claims a fragment of non-zero length but the committed slot holds no child range start. Fragment mount state was written inconsistently (partial commit or cleared range).

Source

Thrown at packages/core/src/mount.rs:540

                    .iter()
                    .all(|mount| { *mount != UNWRITTEN_FRAGMENT_CHILD_MOUNT }),
                "fragment child writer range must be fully written before commit"
            );
            *mount.dynamic_slot_mut(writer.dyn_node_idx) =
                PackedMountedSlot::from_slot(MountedDynamicNodeSlot::Fragment(writer.start));
        });
    }

    pub(crate) fn mounted_fragment_children(
        &self,
        mount: MountId,
        dyn_node_idx: usize,
        len: usize,
    ) -> Vec<MountId> {
        self.try_with_mounted_fragment_children(mount, dyn_node_idx, len, |children| {
            children.to_vec()
        })
        .expect("non-empty mounted fragment should have a child range")
    }

    pub(crate) fn try_with_mounted_fragment_children<R>(
        &self,
        mount: MountId,
        dyn_node_idx: usize,
        len: usize,
        with_children: impl FnOnce(&[MountId]) -> R,
    ) -> Option<R> {
        self.with_mount(mount, |mount| {
            if len == 0 {
                return Some(with_children(&[]));
            }
            let start = mount.dynamic_slot(dyn_node_idx).fragment_start()?;
            mount
                .fragment_child_mounts
                .get(start..start + len)
                .map(with_children)

View on GitHub (pinned to 24f6a829df)

Solutions

  1. This is an internal invariant about mounted fragments. Report it with a minimal reproduction to the Dioxus issue tracker.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at packages/core/src/mount.rs:540 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/ac2119f39347db5c. Report an issue: GitHub.