• I think the fatal_error_handler code is incorrect.

    This registers a global error handler, with window.onerror = function.... The handler attempts to match the wording of the error, looking for deprecated jQuery functions.

    It uses msg.match(), which returns either null or an array, but the code to check for results says:

    if ( typeof erroredFunction !== 'object' || typeof erroredFunction[1] === "undefined" || -1 === jQueryFunctions.indexOf( erroredFunction[1] ) )

    This doesn’t work when the result is null because typeof null === "object" in JavaScript.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I came here by searching why I’m getting this error.

    To add, the line is in admin.php line 96, this is the error:

    if ( typeof erroredFunction !== 'object' || typeof erroredFunction[1] === "undefined" || -1 === jQueryFunctions.indexOf( erroredFunction[1] ) ) {
                        return true;
    }

    Uncaught TypeError: erroredFunction is null

    Hope that helps.

    This error is reported on Github too. We have to add a condition to the line 289 of wp-content/plugins/enable-jquery-migrate-helper/class-jquery-migrate-helper.php to fix it:

    if ( erroredFunction === null || typeof erroredFunction !== 'object' || typeof erroredFunction[1] === "undefined" || -1 === jQueryFunctions.indexOf( erroredFunction[1] ) ) {

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Errors in fatal_error_handler’ is closed to new replies.