{"record":{"id":"1398c2ab77df9b04","repo":"greensock/GSAP","slug":"elornode-not-found","errorCode":null,"errorMessage":"${elOrNode} not found","messagePattern":"(.+?) not found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/Flip.js","lineNumber":167,"sourceCode":"\t\tif (targets !== true) {\n\t\t\ttargets = _toArray(targets);\n\t\t\tcomps = comps.filter(c => {\n\t\t\t\tif (targets.indexOf((c.sd < 0 ? c.b : c.a).element) !== -1) {\n\t\t\t\t    return true;\n\t\t\t\t} else {\n\t\t\t\t\tc.t._gsap.renderTransform(1); // we must force transforms to render on anything that isn't being made position: absolute, otherwise the absolute position happens and then when animation begins it applies transforms which can create a new stacking context, throwing off positioning!\n\t\t\t\t\tif (c.b.isVisible) {\n\t\t\t\t\t\tc.t.style.width = c.b.width + \"px\"; // otherwise things can collapse when contents are made position: absolute.\n\t\t\t\t\t\tc.t.style.height = c.b.height + \"px\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn comps;\n\t},\n\t_makeCompsAbsolute = comps => _orderByDOMDepth(comps, true).forEach(c => (c.a.isVisible || c.b.isVisible) && _makeAbsolute(c.sd < 0 ? c.b : c.a, c.b, 1)),\n\t_findElStateInState = (state, other) => (other && state.idLookup[_parseElementState(other).id]) || state.elementStates[0],\n\t_parseElementState = (elOrNode, props, simple, other) => elOrNode instanceof ElementState ? elOrNode : elOrNode instanceof FlipState ? _findElStateInState(elOrNode, other) : new ElementState(typeof(elOrNode) === \"string\" ? _getEl(elOrNode) || console.warn(elOrNode + \" not found\") : elOrNode, props, simple),\n\t_recordProps = (elState, props) => {\n\t\tlet getProp = gsap.getProperty(elState.element, null, \"native\"),\n\t\t\tobj = elState.props = {},\n\t\t\ti = props.length;\n\t\twhile (i--) {\n\t\t\tobj[props[i]] = (getProp(props[i]) + \"\").trim();\n\t\t}\n\t\tobj.zIndex && (obj.zIndex = parseFloat(obj.zIndex) || 0);\n\t\treturn elState;\n\t},\n\t_applyProps = (element, props) => {\n\t\tlet style = element.style || element, // could pass in a vars object.\n\t\t\tp;\n\t\tfor (p in props) {\n\t\t\tstyle[p] = props[p];\n\t\t}\n\t},\n\t_getID = el => {","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/greensock/GSAP/blob/13e2b790546426a1a2e0e9b409f3f8dc6d6611f2/src/Flip.js#L149-L185","documentation":"_parseElementState accepts a selector string, Element, ElementState, or FlipState. For a string it calls _getEl; if that returns nothing it warns \"<selector> not found\" and constructs an ElementState with the null-ish result. It is the element-state resolution entry used by Flip state APIs.","triggerScenarios":"Passing a selector string to Flip.getState()/from()/to()/fit() that matches zero elements; passing a FlipState where no element state exists for the target (_findElStateInState path); passing null/undefined mistakenly typed as string vs element.","commonSituations":"Framework re-render removed the element between state capture and Flip.from(); misspelled selector; capturing state before elements mount; passing stale references after unmount.","solutions":["Confirm elements exist before capturing or animating state","Re-capture Flip state after DOM updates that add/remove elements","Use element references captured from the live DOM","Check for typos in the selector string"],"exampleFix":"// before\nconst state = Flip.getState('.item');\nlist.innerHTML = ...; // items recreated\nFlip.from(state); // old selectors no longer resolve\n// after\nconst state = Flip.getState('.item');\nlist.innerHTML = ...;\nconst newState = Flip.getState('.item'); // elements exist again\nFlip.from(state, {targets: newState});","handlingStrategy":"type-guard","validationCode":"const el = typeof target === 'string' ? document.querySelector(target) : target;\nif (!(el instanceof Element)) throw new Error(`Flip state target not found: ${target}`);\nconst state = Flip.getState(el);","typeGuard":"function resolvableElement(t) {\n  return t instanceof Element || t instanceof Element && true || (typeof t === 'string' && !!document.querySelector(t));\n}\n// simpler:\nfunction flipTargetExists(t) {\n  if (typeof t === 'string') return !!document.querySelector(t);\n  return t instanceof Element;\n}","tryCatchPattern":null,"preventionTips":["Capture and animate Flip state within the same render cycle","Re-capture state after DOM mutations","Verify selectors resolve before getState/from/to","Avoid stale element references after unmount"],"tags":["flip","dom","selector","element-not-found"],"backgroundTag":"element-not-found","analyzedSha":"13e2b790546426a1a2e0e9b409f3f8dc6d6611f2","analyzedAt":"2026-08-29T08:34:05.027Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}