dianping/cat · error · Error

Provided callback for onchange was not a function.

Error message

Provided callback for onchange was not a function.

What it means

Error "Provided callback for onchange was not a function." thrown in dianping/cat.

Source

Thrown at cat-home/src/main/webapp/js/intro.js:1231

    },
    refresh: function() {
      _setHelperLayerPosition.call(this, document.querySelector('.introjs-helperLayer'));
      _setHelperLayerPosition.call(this, document.querySelector('.introjs-tooltipReferenceLayer'));
      return this;
    },
    onbeforechange: function(providedCallback) {
      if (typeof (providedCallback) === 'function') {
        this._introBeforeChangeCallback = providedCallback;
      } else {
        throw new Error('Provided callback for onbeforechange was not a function');
      }
      return this;
    },
    onchange: function(providedCallback) {
      if (typeof (providedCallback) === 'function') {
        this._introChangeCallback = providedCallback;
      } else {
        throw new Error('Provided callback for onchange was not a function.');
      }
      return this;
    },
    onafterchange: function(providedCallback) {
      if (typeof (providedCallback) === 'function') {
        this._introAfterChangeCallback = providedCallback;
      } else {
        throw new Error('Provided callback for onafterchange was not a function');
      }
      return this;
    },
    oncomplete: function(providedCallback) {
      if (typeof (providedCallback) === 'function') {
        this._introCompleteCallback = providedCallback;
      } else {
        throw new Error('Provided callback for oncomplete was not a function.');
      }
      return this;

View on GitHub (pinned to e815e74d4c)

Solutions

  1. Pass a function to setOnChange or omit the callback.
  2. Check for a typo that passes a non-function value such as undefined.

When it happens

Trigger: Triggered when onchange is assigned a non-function value instead of a callback function.

Common situations: See trigger scenarios.


AI-assisted analysis of dianping/cat@e815e74d4c (2026-08-14). Data as JSON: /api/errors/2666db5a8dffd174. Report an issue: GitHub.