Drupal 10 Jquery Once Error

Created on 20 September 2023, about 1 year ago
Updated 6 March 2024, 8 months ago

Problem/Motivation

We need to replace jQuery.once() with javascript once() in Drupal 10.

Error in hubspot_integration.js file

Uncaught TypeError: $(...).once is not a function
at Object.attach (hubspot_integration.js?v=1.x:4:26)
at drupal.js?v=10.0.10:166:24
at Array.forEach ()
at Drupal.attachBehaviors (drupal.js?v=10.0.10:162:34)
at drupal.init.js?v=10.0.10:32:12
at HTMLDocument.listener (drupal.init.js?v=10.0.10:20:7)

Proposed resolution

   $(once('hubspot_integration', 'html', context)).each(function () {
          //.......
       }
🐛 Bug report
Status

Fixed

Version

2.2

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024