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

Created on 11 May 2023, over 1 year ago
Updated 13 June 2024, 5 months ago

Problem/Motivation

jquery.once is deprecated
(noticed when working on a D10 project)
Mentioned here https://www.drupal.org/node/3158256 โ†’

Steps to reproduce

Project is on ^D10
Install and enable Disqus 2.0.1-alpha6 โ†’
See error in Console on any node where a Disqus comment field is present.

Proposed resolution

Replace core/jquery.once dependency in disqus.libraries.yml with core/once
https://git.drupalcode.org/project/disqus/-/blob/2.0.x/disqus.libraries....
Update JS code and replace $.once() with javascript once()
https://git.drupalcode.org/project/disqus/-/blob/2.0.x/js/disqus.js#L30

Remaining tasks

Provided patch resolves both proposed resolutions.

๐Ÿ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom Michelle-Buckby

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