Semantic-Org/Semantic-UI · error

The method you called is not defined.

Error message

The method you called is not defined.

What it means

This error is logged by the Semantic UI site module when a method name passed to $.site('some.method') does not match any property in the module object. The module's invoke function (site.js:346-404) traverses the module object by splitting the query string on dots/periods; if no matching key is found at any depth, it logs this error. The error is informational — it tells the developer they are calling a non-existent method.

Source

Thrown at src/definitions/globals/site.js:432

    if(instance !== undefined) {
      module.destroy();
    }
    module.initialize();
  }
  return (returnedValue !== undefined)
    ? returnedValue
    : this
  ;
};

$.site.settings = {

  name        : 'Site',
  namespace   : 'site',

  error : {
    console : 'Console cannot be restored, most likely it was overwritten outside of module',
    method : 'The method you called is not defined.'
  },

  debug       : false,
  verbose     : false,
  performance : true,

  modules: [
    'accordion',
    'api',
    'checkbox',
    'dimmer',
    'dropdown',
    'embed',
    'form',
    'modal',
    'nag',
    'popup',
    'rating',

View on GitHub (pinned to 597843ab84)

Solutions

  1. Check the Semantic UI site module documentation for the correct method name.
  2. Inspect the module object: console.log the methods available via $.site.settings to see valid method names.
  3. Remove the invocation or correct the method name spelling.

Example fix

// before
$.site('chnage.setting', 'debug', true, ['accordion']); // typo

// after
$.site('change.setting', 'debug', true, ['accordion']);
Defensive patterns

Strategy: type-guard

Validate before calling

// Validate method name before invoking
var validMethods = ['change.setting', 'setting', 'enable.debug', 'disable.debug', 'enable.verbose', 'disable.verbose', 'enable.console', 'disable.console'];
if (validMethods.indexOf(methodName) !== -1) {
  $.site(methodName);
} else {
  console.warn('Unknown site method:', methodName);
}

Type guard

// Type guard for site module methods
function isValidSiteMethod(name) {
  var valid = ['change.setting','setting','enable.debug','disable.debug','enable.verbose','disable.verbose','enable.console','disable.console','destroy'];
  return typeof name === 'string' && valid.indexOf(name) !== -1;
}

Prevention

When it happens

Trigger: Calling $.site('nonexistent'), $.site('change.setting', 'key', 'val', ['wrongModule']) where 'change.setting' is mistyped, or passing a method name that was renamed or removed in the current version. Also happens when a module name in the modules array does not exist.

Common situations: Typographical errors in method names, version mismatches after upgrading Semantic UI (method renamed), or calling a method that belongs to a different module than 'site'. Also common when copy-pasting code examples from a different version's documentation.

Related errors


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