MagicMirrorOrg/MagicMirror · warning
node not found for removing
Error message
node not found for removing
What it means
removeAnimateCSS is the cleanup counterpart of addAnimateCSS: it removes the animate__ classes and the --animate-duration property. If the element id is not found in the DOM it warns 'node not found for removing' and returns early. This happens when the hide/show sequence targets a node that no longer exists (typically after it was already removed or never added).
Source
Thrown at js/animateCSS.js:153
// don't execute animate: we don't find div
Log.warn("node not found for adding", element);
return;
}
node.style.setProperty("--animate-duration", `${animationTime}s`);
node.classList.add("animate__animated", animationName);
}
/**
* Remove an animation with Animate CSS
* @param {string} [element] div element to animate.
* @param {string} [animation] animation name.
*/
function removeAnimateCSS (element, animation) {
const animationName = `animate__${animation}`;
const node = document.getElementById(element);
if (!node) {
// don't execute animate: we don't find div
Log.warn("node not found for removing", element);
return;
}
node.classList.remove("animate__animated", animationName);
node.style.removeProperty("--animate-duration");
}
if (typeof window === "undefined") module.exports = { AnimateCSSIn, AnimateCSSOut, addAnimateCSS, removeAnimateCSS };
View on GitHub (pinned to 4b4a59534f)
Solutions
- Confirm the module identifier used in AnimateCSSOut exists and renders content.
- Avoid hide/update/remove operations overlapping an exit animation (increase update interval or shorten animationTime).
- Update the MagicMirror core files (js/animateCSS.js) — newer versions may handle this race; clear browser cache after update.
Example fix
// before: AnimateCSSOut on a module that never renders
config: { modules: [{ module: "brokenmodule", animateOut: "fadeOut" }] }
// after: remove the animation or fix the module
config: { modules: [{ module: "workingmodule", animateOut: "fadeOut" }] } Defensive patterns
Strategy: validation
Validate before calling
function canRemoveAnimation(element, animation) {
const node = document.getElementById(element);
return !!node && node.classList.contains(`animate__${animation}`);
}
if (canRemoveAnimation(moduleId, anim)) removeAnimateCSS(moduleId, anim); Type guard
function hasAnimateClass(element) {
const node = document.getElementById(element);
return !!node && node.classList.contains("animate__animated");
} Prevention
- Avoid unmounting/updating a module while its exit animation runs.
- Keep animationTime shorter than the fastest module update interval.
- Clear browser cache after core updates to js/animateCSS.js.
When it happens
Trigger: _hideModule/_showModule finishing sequence tries to strip animation classes from an element id absent from the DOM — module unmounted before the exit animation finished, module never rendered, or id mismatch between add and remove calls.
Common situations: Module hidden with an exit animation while simultaneously being updated/unmounted; AnimateCSSOut on modules that render nothing; fast hide/show toggles racing DOM updates.
Related errors
AI-assisted analysis of MagicMirrorOrg/MagicMirror@4b4a59534f (2026-08-31).
Data as JSON: /api/errors/7f4629788e4f167a.
Report an issue: GitHub.