DioxusLabs/dioxus · error

fragment plan must materialize every new child

Error message

fragment plan must materialize every new child

What it means

`execute_fragment_plan` asserts, after diffing a fragment's children, that the plan created/mounted a mount for every new child node. This invariant panic fires if the diffing internals left some new child unmounted — a bug in fragment diff planning rather than user error.

Source

Thrown at packages/core/src/diff/iterator.rs:451

                });
            } else {
                let mut state = DiffState::new_with_context(dom, None, context);
                state.create_or_diff_placed_range(
                    &inputs,
                    &plan,
                    range.clone(),
                    &mut new_mounts,
                    &mut replaced_nodes,
                );
            }

            for (node, mount) in replaced_nodes.into_iter().rev() {
                node.remove_node(mount, self.dom, self.to.as_deref_mut());
            }
        }

        for (idx, mount) in new_mounts.into_iter().enumerate() {
            let mount = mount.expect("fragment plan must materialize every new child");
            self.dom
                .set_mounted_fragment_child(new_children, new_offset + idx, mount);
        }
    }

    /// Materialize every non-stable child in a fragment placement range at the current renderer
    /// insertion site. Stable children inside the range are DOM-empty anchors in the logical order,
    /// so they are skipped while neighbouring placed children are spliced as one host segment.
    fn create_or_diff_placed_range<'a>(
        &mut self,
        inputs: &FragmentInputs<'a>,
        plan: &FragmentPlacementPlan,
        range: Range<usize>,
        new_mounts: &mut [Option<MountId>],
        replaced_nodes: &mut Vec<(&'a VNode, MountId)>,
    ) -> usize {
        let FragmentInputs {
            old,

View on GitHub (pinned to 24f6a829df)

Solutions

  1. This is an internal diffing invariant about fragment children. 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/diff/iterator.rs:451 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/9ec4a07edb3bb8c2. Report an issue: GitHub.