{"record":{"id":"52f36e24cfc30873","repo":"dianping/cat","slug":"provided-callback-for-onbeforechange-was-not-a-fun","errorCode":null,"errorMessage":"Provided callback for onbeforechange was not a function","messagePattern":"Provided callback for onbeforechange was not a function","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cat-home/src/main/webapp/js/intro.js","lineNumber":1223,"sourceCode":"    },\n    previousStep: function() {\n      _previousStep.call(this);\n      return this;\n    },\n    exit: function() {\n      _exitIntro.call(this, this._targetElement);\n      return this;\n    },\n    refresh: function() {\n      _setHelperLayerPosition.call(this, document.querySelector('.introjs-helperLayer'));\n      _setHelperLayerPosition.call(this, document.querySelector('.introjs-tooltipReferenceLayer'));\n      return this;\n    },\n    onbeforechange: function(providedCallback) {\n      if (typeof (providedCallback) === 'function') {\n        this._introBeforeChangeCallback = providedCallback;\n      } else {\n        throw new Error('Provided callback for onbeforechange was not a function');\n      }\n      return this;\n    },\n    onchange: function(providedCallback) {\n      if (typeof (providedCallback) === 'function') {\n        this._introChangeCallback = providedCallback;\n      } else {\n        throw new Error('Provided callback for onchange was not a function.');\n      }\n      return this;\n    },\n    onafterchange: function(providedCallback) {\n      if (typeof (providedCallback) === 'function') {\n        this._introAfterChangeCallback = providedCallback;\n      } else {\n        throw new Error('Provided callback for onafterchange was not a function');\n      }\n      return this;","sourceCodeStart":1205,"sourceCodeEnd":1241,"githubUrl":"https://github.com/dianping/cat/blob/e815e74d4c2dd74edac831241f1253fcc7d25381/cat-home/src/main/webapp/js/intro.js#L1205-L1241","documentation":"Error \"Provided callback for onbeforechange was not a function\" thrown in dianping/cat.","triggerScenarios":"Triggered when onbeforechange is assigned a non-function value (e.g. undefined result, string, or object) instead of a callback function.","commonSituations":"See trigger scenarios.","solutions":["Pass a function to setOnBeforeChange or omit the callback.","Check for a typo that passes a non-function value such as undefined."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e815e74d4c2dd74edac831241f1253fcc7d25381","analyzedAt":"2026-08-14T14:22:34.512Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}