greensock/GSAP · warning
${elOrNode} not found
Error message
${elOrNode} not found What it means
_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.
Source
Thrown at src/Flip.js:167
if (targets !== true) {
targets = _toArray(targets);
comps = comps.filter(c => {
if (targets.indexOf((c.sd < 0 ? c.b : c.a).element) !== -1) {
return true;
} else {
c.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!
if (c.b.isVisible) {
c.t.style.width = c.b.width + "px"; // otherwise things can collapse when contents are made position: absolute.
c.t.style.height = c.b.height + "px";
}
}
});
}
return comps;
},
_makeCompsAbsolute = comps => _orderByDOMDepth(comps, true).forEach(c => (c.a.isVisible || c.b.isVisible) && _makeAbsolute(c.sd < 0 ? c.b : c.a, c.b, 1)),
_findElStateInState = (state, other) => (other && state.idLookup[_parseElementState(other).id]) || state.elementStates[0],
_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),
_recordProps = (elState, props) => {
let getProp = gsap.getProperty(elState.element, null, "native"),
obj = elState.props = {},
i = props.length;
while (i--) {
obj[props[i]] = (getProp(props[i]) + "").trim();
}
obj.zIndex && (obj.zIndex = parseFloat(obj.zIndex) || 0);
return elState;
},
_applyProps = (element, props) => {
let style = element.style || element, // could pass in a vars object.
p;
for (p in props) {
style[p] = props[p];
}
},
_getID = el => {View on GitHub (pinned to 13e2b79054)
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
Example fix
// before
const state = Flip.getState('.item');
list.innerHTML = ...; // items recreated
Flip.from(state); // old selectors no longer resolve
// after
const state = Flip.getState('.item');
list.innerHTML = ...;
const newState = Flip.getState('.item'); // elements exist again
Flip.from(state, {targets: newState}); Defensive patterns
Strategy: type-guard
Validate before calling
const el = typeof target === 'string' ? document.querySelector(target) : target;
if (!(el instanceof Element)) throw new Error(`Flip state target not found: ${target}`);
const state = Flip.getState(el); Type guard
function resolvableElement(t) {
return t instanceof Element || t instanceof Element && true || (typeof t === 'string' && !!document.querySelector(t));
}
// simpler:
function flipTargetExists(t) {
if (typeof t === 'string') return !!document.querySelector(t);
return t instanceof Element;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Framework re-render removed the element between state capture and Flip.from(); misspelled selector; capturing state before elements mount; passing stale references after unmount.
Related errors
- Element not found:
- Element not found: ${t}
- ScrollSmoother needs a valid content element.
- scrollTo target doesn't exist. Using 0
- Not a valid state object.
AI-assisted analysis of greensock/GSAP@13e2b79054 (2026-08-29).
Data as JSON: /api/errors/1398c2ab77df9b04.
Report an issue: GitHub.