Drupal 10 - Uncaught TypeError: $(...).once is not a function.

Created on 30 September 2022, about 2 years ago
Updated 11 February 2023, almost 2 years ago

Problem/Motivation

Getting the error after installing the module on D10.

Steps to reproduce

  1. Install the module on D10
  2. Configure Views
  3. Open page with MixItUp filters and check console

Error:

Uncaught TypeError: $(...).once is not a function
    at Object.bindHandlers (mixitup_views.js?v=1.x:76:27)
    at Object.init (mixitup_views.js?v=1.x:65:16)
    at String.<anonymous> (mixitup_views.js?v=1.x:216:22)
    at Function.each (jquery.min.js?v=3.6.1:2:3053)
    at Object.attach (mixitup_views.js?v=1.x:210:9)
    at drupal.js?v=10.0.0-beta2:166:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (drupal.js?v=10.0.0-beta2:162:34)
    at drupal.init.js?v=10.0.0-beta2:32:12
    at HTMLDocument.listener (drupal.init.js?v=10.0.0-beta2:20:7)

Proposed resolution

The core/jquery.once the asset library is deprecated in Drupal 9.3.0 and will be removed in Drupal 10.0.0.

Replace jquery/once by core/once.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡ͺGeorgia evasby

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024