leptos-rs/leptos · warning
[HOT RELOADING] Unmatched action
Error message
[HOT RELOADING] Unmatched action
What it means
The patch action received from the server did not match any action variant handled by patch.js (ClearChildren, ReplaceWith, ChangeTagName, attributes, SetText, AppendChildren, RemoveChild, InsertChild, InsertChildAfter). The patch is skipped and logged. This usually means the client patch.js and the server-side diff serializer disagree on the action schema, or a new action variant was added server-side without updating the JS patcher.
Source
Thrown at leptos_hot_reload/src/patch.js:218
child.node &&
(!after || !(after.node || after.start).nextSibling)
) {
child.node.appendChild(newChild);
} else {
const node = child.node || child.end;
const parent =
node.nodeType === Node.COMMENT_NODE ? node.parentNode : node;
if (!after) {
parent.appendChild(newChild);
} else {
parent.insertBefore(
newChild,
(after.node || after.start).nextSibling,
);
}
}
} else {
console.warn("[HOT RELOADING] Unmatched action", action);
}
}
}
}
} catch (e) {
console.warn("[HOT RELOADING] Error: ", e);
}
function fromReplacementNode(node, actualChildren) {
if (node.Html) {
return fromHTML(node.Html);
} else if (node.Fragment) {
const frag = document.createDocumentFragment();
for (const child of node.Fragment) {
frag.appendChild(fromReplacementNode(child, actualChildren));
}
return frag;
} else if (node.Element) {View on GitHub (pinned to 32d20f6c9d)
Solutions
- Hard-refresh the browser / clear cache so the patch.js served matches the server crate version.
- Align leptos and leptos_hot_reload to the same version in Cargo.toml (same workspace lockfile).
- Log the unmatched `action` object to identify the new variant and update patch.js's dispatch chain to handle it.
- Check for duplicate/conflicting leptos versions via `cargo tree -d`.
Example fix
// patch.js dispatch
// before
} else {
console.warn("[HOT RELOADING] Unmatched action", action);
}
// after
} else if (action.SetAttributeList) {
// handle the new server-side variant
} else {
console.warn("[HOT RELOADING] Unmatched action", action);
} Defensive patterns
Strategy: fallback
Try / catch
// If wiring patch() yourself:
try {
patch(json);
} catch (e) {
console.warn('[HOT RELOADING] patch failed, falling back to reload', e);
location.reload();
} Prevention
- Keep patch.js in sync with the leptos version generating actions.
- Clear cached assets on crate upgrades (bust cache / restart dev server).
- Run `cargo tree -d` to detect duplicate leptos versions.
When it happens
Trigger: Server emits a patch action type not present in patch.js's if/else chain — e.g. a newer leptos version introducing a new HotReloadAction variant, or a corrupted/mismatched JSON payload.
Common situations: Upgrading the leptos/leptos_hot_reload crate without refreshing the bundled patch.js; mixing workspace crate versions; stale cached assets served by the dev server.
Related errors
- InsertChildAfter could not build children.
- [HOT RELOADING] Could not find replacement node at
- [HOT RELOADING] Building children, encountered
- {location:?} expected context of type {type_name:?} to be pr
- Tried to access a reactive value that has already been dispo
AI-assisted analysis of leptos-rs/leptos@32d20f6c9d (2026-09-01).
Data as JSON: /api/errors/ce14a0122f2411a9.
Report an issue: GitHub.