- Issue created by @maxilein
- Status changed to Closed: works as designed
about 1 month ago 9:51am 3 May 2025 - 🇷🇸Serbia levmyshkin Novi Sad, Serbia
What’s blowing up?
Drupal 11 ships with jQuery 4.0.0-beta. One of the breaking changes in jQuery 4 is that the long-deprecated helper jQuery.isFunction() (and the alias $.isFunction) has been removed. The minified Waypoints 4.0.1 library that your theme/module loads still calls that helper. In the compressed file the call appears as t.isFunction, where t is the local reference to jQuery. Because the method no longer exists, the browser throws:
Uncaught TypeError: t.isFunction is not a function
right where Waypoints tries to register a waypoint.
Fix options:
1. Patch Waypoints (recommended)
Replace every occurence of $.isFunction(…) with typeof … === 'function'2. Add a one-line polyfill Before Waypoints loads, inject js
js if (typeof jQuery.isFunction !== 'function') { jQuery.isFunction = obj => typeof obj === 'function'; }
3. Use jQuery Migrate 4 plugin Load the official migrate plugin that re-adds removed helpers.
Quick Drupal-specific patch
Create my_module/js/jquery4-polyfills.js:/** * Tiny polyfills for libraries that still expect jQuery < 4. */ (( $, Drupal, drupalSettings ) => { if (typeof $.isFunction !== 'function') { $.isFunction = obj => typeof obj === 'function'; } })(jQuery, Drupal, drupalSettings);
Then add this library to your theme/modules’ libraries.yml before the Waypoints library to guarantee it is evaluated first.
Long-term
Track the “Deprecated t.isFunction call on D11” issue in the jQuery Waypoints queue; once a new release lands, remove your patch/polyfill.
DrupalAudit any other contributed or custom scripts for calls to $.isFunction, $.isNumeric, $.trim, jQuery.type, etc.—all of them vanished in jQuery 4. Drupal’s upgrade status report will flag many of these automatically.
DrupalOnce Waypoints (and any similar libraries) are patched, Drupal 11 + jQuery 4 will run without the “isFunction” crash.