{"record":{"id":"7f4629788e4f167a","repo":"MagicMirrorOrg/MagicMirror","slug":"node-not-found-for-removing","errorCode":null,"errorMessage":"node not found for removing","messagePattern":"node not found for removing","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"js/animateCSS.js","lineNumber":153,"sourceCode":"\t\t// don't execute animate: we don't find div\n\t\tLog.warn(\"node not found for adding\", element);\n\t\treturn;\n\t}\n\tnode.style.setProperty(\"--animate-duration\", `${animationTime}s`);\n\tnode.classList.add(\"animate__animated\", animationName);\n}\n\n/**\n * Remove an animation with Animate CSS\n * @param {string} [element] div element to animate.\n * @param {string} [animation] animation name.\n */\nfunction removeAnimateCSS (element, animation) {\n\tconst animationName = `animate__${animation}`;\n\tconst node = document.getElementById(element);\n\tif (!node) {\n\t\t// don't execute animate: we don't find div\n\t\tLog.warn(\"node not found for removing\", element);\n\t\treturn;\n\t}\n\tnode.classList.remove(\"animate__animated\", animationName);\n\tnode.style.removeProperty(\"--animate-duration\");\n}\nif (typeof window === \"undefined\") module.exports = { AnimateCSSIn, AnimateCSSOut, addAnimateCSS, removeAnimateCSS };\n","sourceCodeStart":135,"sourceCodeEnd":160,"githubUrl":"https://github.com/MagicMirrorOrg/MagicMirror/blob/4b4a59534f7da01e4030e46029fe9dd649a7675e/js/animateCSS.js#L135-L160","documentation":"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).","triggerScenarios":"_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.","commonSituations":"Module hidden with an exit animation while simultaneously being updated/unmounted; AnimateCSSOut on modules that render nothing; fast hide/show toggles racing DOM updates.","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."],"exampleFix":"// before: AnimateCSSOut on a module that never renders\nconfig: { modules: [{ module: \"brokenmodule\", animateOut: \"fadeOut\" }] }\n// after: remove the animation or fix the module\nconfig: { modules: [{ module: \"workingmodule\", animateOut: \"fadeOut\" }] }","handlingStrategy":"validation","validationCode":"function canRemoveAnimation(element, animation) {\n  const node = document.getElementById(element);\n  return !!node && node.classList.contains(`animate__${animation}`);\n}\nif (canRemoveAnimation(moduleId, anim)) removeAnimateCSS(moduleId, anim);","typeGuard":"function hasAnimateClass(element) {\n  const node = document.getElementById(element);\n  return !!node && node.classList.contains(\"animate__animated\");\n}","tryCatchPattern":null,"preventionTips":["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."],"tags":["dom","animation","frontend","race-condition"],"backgroundTag":"element-not-found","analyzedSha":"4b4a59534f7da01e4030e46029fe9dd649a7675e","analyzedAt":"2026-08-31T21:49:42.591Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}