{"record":{"id":"ce14a0122f2411a9","repo":"leptos-rs/leptos","slug":"hot-reloading-unmatched-action","errorCode":null,"errorMessage":"[HOT RELOADING] Unmatched action","messagePattern":"\\[HOT RELOADING\\] Unmatched action","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"leptos_hot_reload/src/patch.js","lineNumber":218,"sourceCode":"              child.node &&\n              (!after || !(after.node || after.start).nextSibling)\n            ) {\n              child.node.appendChild(newChild);\n            } else {\n              const node = child.node || child.end;\n              const parent =\n                node.nodeType === Node.COMMENT_NODE ? node.parentNode : node;\n              if (!after) {\n                parent.appendChild(newChild);\n              } else {\n                parent.insertBefore(\n                  newChild,\n                  (after.node || after.start).nextSibling,\n                );\n              }\n            }\n          } else {\n            console.warn(\"[HOT RELOADING] Unmatched action\", action);\n          }\n        }\n      }\n    }\n  } catch (e) {\n    console.warn(\"[HOT RELOADING] Error: \", e);\n  }\n\n  function fromReplacementNode(node, actualChildren) {\n    if (node.Html) {\n      return fromHTML(node.Html);\n    } else if (node.Fragment) {\n      const frag = document.createDocumentFragment();\n      for (const child of node.Fragment) {\n        frag.appendChild(fromReplacementNode(child, actualChildren));\n      }\n      return frag;\n    } else if (node.Element) {","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/leptos-rs/leptos/blob/32d20f6c9d517451d77beb68d88c7716823dac41/leptos_hot_reload/src/patch.js#L200-L236","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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`."],"exampleFix":"// patch.js dispatch\n// before\n} else {\n  console.warn(\"[HOT RELOADING] Unmatched action\", action);\n}\n// after\n} else if (action.SetAttributeList) {\n  // handle the new server-side variant\n} else {\n  console.warn(\"[HOT RELOADING] Unmatched action\", action);\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// If wiring patch() yourself:\ntry {\n  patch(json);\n} catch (e) {\n  console.warn('[HOT RELOADING] patch failed, falling back to reload', e);\n  location.reload();\n}","preventionTips":["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."],"tags":["hot-reload","version-mismatch","leptos"],"backgroundTag":"patch-schema-version-mismatch","analyzedSha":"32d20f6c9d517451d77beb68d88c7716823dac41","analyzedAt":"2026-09-01T18:55:42.580Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}