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

Created on 28 July 2022, over 2 years ago
Updated 16 April 2025, 8 days ago

Problem/Motivation

Getting the error after installing the module on D10. and I found that

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

Steps to reproduce

Install the module on D10 instance check console.
Error:-

js_LmR1dvIDvNTeP8uAa7Pu-Kq4gRf_pzGg78PKQdlKfHg.js:3806 Uncaught TypeError: $(...).once is not a function
    at Object.attach (js_LmR1dvIDvNTeP8uAa7Pu-Kq4gRf_pzGg78PKQdlKfHg.js:3806:34)
    at js_LmR1dvIDvNTeP8uAa7Pu-Kq4gRf_pzGg78PKQdlKfHg.js:203:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (js_LmR1dvIDvNTeP8uAa7Pu-Kq4gRf_pzGg78PKQdlKfHg.js:200:34)
    at js_LmR1dvIDvNTeP8uAa7Pu-Kq4gRf_pzGg78PKQdlKfHg.js:431:12
    at HTMLDocument.listener (js_LmR1dvIDvNTeP8uAa7Pu-Kq4gRf_pzGg78PKQdlKfHg.js:419:7)

Proposed resolution

Remaining tasks

Replace jquery/once by core/once.

User interface changes

API changes

Data model changes

📌 Task
Status

Closed: duplicate

Version

3.0

Component

Code

Created by

🇮🇳India omkar-pd

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

Merge Requests

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