Semantic-Org/Semantic-UI · error

The target or popup you specified does not exist on the page

Error message

The target or popup you specified does not exist on the page

What it means

set.position() starts with an exit check (popup.js:742-745): if either the target element ($target) or the popup element ($popup) has length 0, it logs error.notFound and returns. Positioning cannot proceed because there is nothing to position or to position against.

Source

Thrown at src/definitions/modules/popup.js:1458

  // distance away from activating element in px
  distanceAway   : 0,

  // number of pixels an element is allowed to be "offstage" for a position to be chosen (allows for rounding)
  jitter         : 2,

  // offset on aligning axis from calculated position
  offset         : 0,

  // maximum times to look for a position before failing (9 positions total)
  maxSearchDepth : 15,

  error: {
    invalidPosition : 'The position you specified is not a valid position',
    cannotPlace     : 'Popup does not fit within the boundaries of the viewport',
    method          : 'The method you called is not defined.',
    noTransition    : 'This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>',
    notFound        : 'The target or popup you specified does not exist on the page'
  },

  metadata: {
    activator : 'activator',
    content   : 'content',
    html      : 'html',
    offset    : 'offset',
    position  : 'position',
    title     : 'title',
    variation : 'variation'
  },

  className   : {
    active       : 'active',
    basic        : 'basic',
    animating    : 'animating',
    dropdown     : 'dropdown',
    fluid        : 'fluid',

View on GitHub (pinned to 597843ab84)

Solutions

  1. Ensure the target element exists at show time (verify $(selector).length before .popup('show')).
  2. Provide a popup element (.ui.popup) or valid inline content so $popup is non-empty.
  3. For dynamic UIs, initialize/rebind the popup after the target is in the DOM, or use delegation.

Example fix

// before
$('#gone').popup({ popup: '.ui.popup' }).popup('show'); // target removed -> [94]

// after
if ($('#btn').length && $('.ui.popup').length) {
  $('#btn').popup({ popup: '.ui.popup' }).popup('show');
}
Defensive patterns

Strategy: validation

Validate before calling

var $t = $(targetSelector), $p = $('.ui.popup');
if ($t.length === 0 || $p.length === 0) {
  throw new Error('Popup target or popup element missing');
}
$t.popup({ popup: $p }).popup('show');

Prevention

When it happens

Trigger: The activator/target selector matches nothing ($target empty) when the popup tries to position — e.g. popup attached via a selector whose element was removed; OR the popup element itself ($popup / .ui.popup) is absent; OR inline popup with no popup content and target not resolved. Triggered on show/reposition.

Common situations: Targets removed from the DOM (SPAs) before the popup shows; popup initialized on a selector that no longer exists; missing .ui.popup element when popup is not inline; dynamic content races where show() fires before the target renders.

Related errors


AI-assisted analysis of Semantic-Org/Semantic-UI@597843ab84 (2026-08-13). Data as JSON: /api/errors/8cffa5555f537a1d. Report an issue: GitHub.